-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add LoadingImage Page and Config page
- Loading branch information
1 parent
ed0012d
commit 370788f
Showing
10 changed files
with
96 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Loading images to component using ImageSwift | ||
|
||
## Overview | ||
|
||
In **ImageSwift**, loading images into Unity GameObjects and sprites is a straightforward process. This section provides guidance on using the library to dynamically load and display images within your Unity project. | ||
|
||
```csharp filename="C#" | ||
ImageSwift.Load(string: url).Into(targetComponent); | ||
``` | ||
|
||
Learn more about these functions down. | ||
|
||
### `Load()` | ||
|
||
The `Load` function is the starting point for fetching an image in ImageSwift. It is a static method that returns an instance of the `ImageSwift` class, allowing you to chain additional methods for customization. | ||
|
||
#### Syntax: | ||
|
||
```csharp filename="C#" | ||
ImageSwift.Load(string url); | ||
``` | ||
|
||
Parameter | ||
`url` (string): The URL of the image to be loaded. | ||
|
||
##### Example: | ||
```csharp filename="C#" | ||
ImageSwift.Load("https://example.com/image.jpg"); | ||
``` | ||
This initiates the process of loading the image from the specified URL. | ||
|
||
### `Into()` | ||
The Into function is used to specify the target where the loaded image should be applied. It supports various Unity components, allowing you to display images in different contexts. | ||
|
||
##### Example: | ||
```csharp filename="C#" | ||
ImageSwift Into(GameObject gameObject); | ||
ImageSwift Into(SpriteRenderer spriteRenderer); | ||
ImageSwift Into(RawImage rawImage); | ||
ImageSwift Into(Image uiImage); | ||
ImageSwift Into(Sprite sprite); | ||
``` | ||
|
||
Examples: | ||
```csharp filename="C#" | ||
// Loading into a SpriteRenderer | ||
ImageSwift.Load("https://example.com/image.jpg").Into(spriteRenderer); | ||
|
||
// Loading into a RawImage | ||
ImageSwift.Load("https://example.com/image.jpg").Into(rawImageGameObject); | ||
|
||
// Loading into a Unity UI Image | ||
ImageSwift.Load("https://example.com/image.jpg").Into(uiImage); | ||
|
||
// Loading into a sprite | ||
ImageSwift.Load("https://example.com/image.jpg").Into(sprite); | ||
|
||
``` | ||
This determines where the loaded image should be displayed based on the specified target. | ||
|
||
ImageSwift provides callbacks for certain events learn about them more [here](/callback). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# ImageSwift Configuration | ||
|
||
## Overview | ||
|
||
**ImageSwift** provides a flexible configuration system that allows users to customize the behavior and settings of the library according to their project requirements. This section covers the configuration options available and how to use them effectively. | ||
|
||
## Configuration File | ||
|
||
### Creating a Configuration File | ||
|
||
To create a configuration file for `ImageSwift`, follow these steps: | ||
|
||
1. **Create a ScriptableObject:** | ||
|
||
Create a new C# script that extends `ScriptableObject` to represent the configuration. For example: | ||
|
||
```csharp | ||
using UnityEngine; | ||
|
||
[CreateAssetMenu(fileName = "ImageSwiftConfig", menuName = "ImageSwift/ImageSwiftConfig")] | ||
public class ImageSwiftConfig : ScriptableObject | ||
{ | ||
// Configuration options go here | ||
public int MaxConcurrentDownloads = 5; | ||
public int CompressionQuality = 75; | ||
public bool UseCustomHeaders = false; | ||
// Add more configuration options as needed | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Add ImageSwift to your Unity project |