Class TextureNode
Building block to create suitable hierarchies for using textures in the UI.
Implements
Inherited Members
Namespace: Fusee.Engine.Gui
Assembly: Fusee.Engine.Gui.dll
Syntax
public class TextureNode : SceneNode, INode
Methods
Create(String, Texture, MinMaxRect, MinMaxRect, float2)
Creates a SceneNodeContainer with the proper components and children for rendering a nine sliced texture.
Declaration
public static TextureNode Create(string name, Texture tex, MinMaxRect anchors, MinMaxRect offsets, float2 diffuseTexTiles)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the SceneNodeContainer. |
Texture | tex | Diffuse texture. |
MinMaxRect | anchors | Anchors for the mesh. Influences the scaling of the object if the enclosing canvas is resized. |
MinMaxRect | offsets | Offsets for the mesh. Defines the position of the object relative to its enclosing UI element. |
float2 | diffuseTexTiles | The tiling of the diffuse texture. |
Returns
Type | Description |
---|---|
TextureNode |
Create(String, Texture, MinMaxRect, MinMaxRect, float2, float4, Single, Single, Single, Single, Single)
Creates a SceneNodeContainer with the proper components and children for rendering a nine sliced texture. By default the border thickness is calculated relative to a unit plane. For a thicker border set the border thickness to the desired value, 2 means a twice as thick border.
Declaration
public static TextureNode Create(string name, Texture tex, MinMaxRect anchors, MinMaxRect offsets, float2 tiles, float4 borders, float borderThicknessLeft = 1F, float borderThicknessRight = 1F, float borderThicknessTop = 1F, float borderThicknessBottom = 1F, float borderScaleFactor = 1F)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the SceneNodeContainer. |
Texture | tex | Diffuse texture. |
MinMaxRect | anchors | Anchors for the mesh. Influences the scaling of the object if the enclosing canvas is resized. |
MinMaxRect | offsets | Offsets for the mesh. Defines the position of the object relative to its enclosing UI element. |
float2 | tiles | Defines the tiling of the inner rectangle of the texture. Use float2.one if you do not desire tiling. |
float4 | borders | Defines the nine tiles of the texture. Order: left, right, top, bottom. Value is measured in percent from the respective edge of texture. |
System.Single | borderThicknessLeft | Border thickness for the left border. |
System.Single | borderThicknessRight | Border thickness for the right border. |
System.Single | borderThicknessTop | Border thickness for the top border. |
System.Single | borderThicknessBottom | Border thickness for the bottom border. |
System.Single | borderScaleFactor | Default value is 1. Set this to scale the border thickness if you use canvas render mode SCREEN. |
Returns
Type | Description |
---|---|
TextureNode |
CreateAsync(String, Texture, MinMaxRect, MinMaxRect, float2)
Creates a SceneNodeContainer with the proper components and children for rendering a nine sliced texture.
Declaration
public static async Task<TextureNode> CreateAsync(string name, Texture tex, MinMaxRect anchors, MinMaxRect offsets, float2 diffuseTexTiles)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the SceneNodeContainer. |
Texture | tex | Diffuse texture. |
MinMaxRect | anchors | Anchors for the mesh. Influences the scaling of the object if the enclosing canvas is resized. |
MinMaxRect | offsets | Offsets for the mesh. Defines the position of the object relative to its enclosing UI element. |
float2 | diffuseTexTiles | The tiling of the diffuse texture. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<TextureNode> |
CreateAsync(String, Texture, MinMaxRect, MinMaxRect, float2, float4, Single, Single, Single, Single, Single)
Creates a SceneNodeContainer with the proper components and children for rendering a nine sliced texture. By default the border thickness is calculated relative to a unit plane. For a thicker border set the border thickness to the desired value, 2 means a twice as thick border.
Declaration
public static async Task<TextureNode> CreateAsync(string name, Texture tex, MinMaxRect anchors, MinMaxRect offsets, float2 tiles, float4 borders, float borderThicknessLeft = 1F, float borderThicknessRight = 1F, float borderThicknessTop = 1F, float borderThicknessBottom = 1F, float borderScaleFactor = 1F)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the SceneNodeContainer. |
Texture | tex | Diffuse texture. |
MinMaxRect | anchors | Anchors for the mesh. Influences the scaling of the object if the enclosing canvas is resized. |
MinMaxRect | offsets | Offsets for the mesh. Defines the position of the object relative to its enclosing UI element. |
float2 | tiles | Defines the tiling of the inner rectangle of the texture. Use float2.one if you do not desire tiling. |
float4 | borders | Defines the nine tiles of the texture. Order: left, right, top, bottom. Value is measured in percent from the respective edge of texture. |
System.Single | borderThicknessLeft | Border thickness for the left border. |
System.Single | borderThicknessRight | Border thickness for the right border. |
System.Single | borderThicknessTop | Border thickness for the top border. |
System.Single | borderThicknessBottom | Border thickness for the bottom border. |
System.Single | borderScaleFactor | Default value is 1. Set this to scale the border thickness if you use canvas render mode SCREEN. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<TextureNode> |