UIImage
Enumerations
- FillMode
- Values:
None = 0 - Default image render
Horizontal = 1 - Render image with horizontal filling
Vertical = 2 - Render image with vertical filling
Radial90 = 3 - Render image with radial filling, with center in corners
Radial180 = 4 - Render image with radial filling, with center in middles of edges
Radial360 = 5 - Render image with radial filling, with center in middle of image
- FillOrigin
- Values:
Bottom = 0 - Anchor filling mode to bottom
Left = 1 - Anchor filling mode to left
Top = 2 - Anchor filling mode to top
Right = 3 - Anchor filling mode to right
Classes
- UIImage : NativeComponent
Note
UIFrame component is automatically added to the node if it is not already present
This component is used to render UI image in Canvas.
The image is positioned in pixels from the center of the viewport. +X is to the right, +Y is to the top.
Note
Don’t forget to set the size or the image will not be seen
Example:
let canvas = create_node()
add_component(canvas, new UICanvas())
let image = create_node(NodeData(parent = canvas,
position = float3(100.0, 100.0, 0.0)
))
add_component(image, new UIImage(
textureId = request_texture("image.png"),
size = float2(100., 100.)
))
- Properties:
- UIImage.textureId: TextureId
- UIImage.textureId =(value: TextureId)
Texture of the image. Default is null.
- Arguments:
value : TextureId
- UIImage.color: float4
- UIImage.color =(value: float4)
Color of the image. Default is white.
- Arguments:
value : float4
- UIImage.pivot: float2
- UIImage.pivot =(value: float2)
Node’s origin relative to it’s content. Left-top of the content is (0,0), right-bottom is (1,1). Default is (0.5, 0.5).
- Arguments:
value : float2
- UIImage.size: float2
- UIImage.size =(value: float2)
Size of the image. This field can only be accessed in code. The same effect can be achieved by changing UIFrame.size property.
To change the value in editor use UIFrame.size of the node.
- Arguments:
value : float2
- UIImage.localPosition2D: float2
- UIImage.localPosition2D =(value: float2)
Local position of the image. Default is (0, 0).
- Arguments:
value : float2
- UIImage.uvRegion: float4
- UIImage.uvRegion =(value: float4)
UV region of the image(X offset, Y offset, X size, Y size). Used for atlas usage. Default is (0, 0, 1, 1).
- Arguments:
value : float4
- UIImage.nineGrid: float4
- UIImage.nineGrid =(value: float4)
The render mode of the canvas. Default is ScreenSpaceOverlay
- Arguments:
value : float4
- UIImage.pixelMultiplier: float
- UIImage.pixelMultiplier =(value: float)
Pixel multiplier. Used for global UI scaling. Default is 1.0.
- Arguments:
value : float
- UIImage.fillMode: FillMode
- UIImage.fillMode =(value: FillMode)
Fill mode of the image. Default is None.
- Arguments:
value : FillMode
- UIImage.fillOrigin: FillOrigin
- UIImage.fillOrigin =(value: FillOrigin)
Fill origin of the image. Default is Bottom.
- Arguments:
value : FillOrigin
- UIImage.fillAmount: float
- UIImage.fillAmount =(value: float)
Fill amount of the image. Default is 1.0.
- Arguments:
value : float
- UIImage.fillClockwise: bool
- UIImage.fillClockwise =(value: bool)
Fill clockwise of the image. Default is true.
- Arguments:
value : bool
- UIImage.grayScale: bool
- UIImage.grayScale =(value: bool)
Enable grayscale rendering. Default is false.
- Arguments:
value : bool
- UIImage.grayScaleFactor: float
- UIImage.grayScaleFactor =(value: float)
Grayscale factor. Used if grayScale is true. Default is 1.0.
- Arguments:
value : float