class
ImageFileGenerator
public class ImageFileGenerator : TextureGenerator Load images from disk and convert them to textures
Constructors
ImageFileGenerator() Properties
| Name | Type | Description |
|---|---|---|
FilePath | String | The path to the image file, relative to any other assets in the project. |
MaxSize | Int32 | The maximum size of the image in pixels. If the imported image is larger than this (after cropping), it will be downscaled to fit. |
ConvertHeightToNormals | Boolean | When enabled, the output texture will be a normal map generated from the heightmap of the image. |
NormalScale | Single | The scale of the normal map when using ConvertHeightToNormals. If negative, the normal map will be inverted. |
Rotate | Single | How much to rotate the image by, in degrees. This is applied after cropping and padding. |
FlipVertical | Boolean | Whether or not to flip the image vertically. This is done after everything else has been applied. |
FlipHorizontal | Boolean | Whether or not to flip the image horizontally. This is done after everything else has been applied. |
Cropping | Margin | How many pixels from each edge to crop from the image. If negative values are used, the image will be expanded instead of cropped. |
Padding | Margin | How many pixels of padding from each edge. After the image has been cropped, padding is added without affecting the size of the image (scaling the original image down to fit padded margins). |
InvertColor | Boolean | Whether or not to invert the colors of the image. |
Tint | Color | The color the image should be tinted. This effectively multiplies the color of each pixel by this color (including alpha). |
Blur | Single | The intensity of the blur effect. If 0, no blur is applied. |
Sharpen | Single | The intensity of the sharpen effect. If 0, no sharpening is applied. |
Brightness | Single | The brightness of the image. |
Contrast | Single | The contrast of the image. |
Saturation | Single | The saturation of the image. |
Hue | Single | How much to adjust the hue of the image, in degrees. If 0, no hue adjustment is applied. |
Colorize | Boolean | When enabled, every pixel in the image will be re-colored to the TargetColor (interpolated by the alpha). |
TargetColor | Color | When Colorize is enabled, this is the target color that every pixel in the image will be re-colored to. |
CacheToDisk virtual | Boolean |
Methods
virtual EmbeddedResource? CreateEmbeddedResource() Assembly:
Sandbox.Engine Namespace: Sandbox.Resources Full Name: Sandbox.Resources.ImageFileGenerator