Class RenderToTextureControl
UI container control that can render children to texture and display pre-cached texture instead of drawing children every frame. It can be also used to render part of UI to texture and use it in material or shader.
Implements
Namespace: FlaxEngine.GUI
Assembly: FlaxEngine.CSharp.dll
Syntax
[ActorToolbox("GUI")]
public class RenderToTextureControl : ContainerControl, IComparable, IDrawable
Constructors
RenderToTextureControl()
Declaration
public RenderToTextureControl()
Properties
AutomaticInvalidate
Gets or sets the value whether cached texture data should be invalidated automatically (eg. when child control changes).
Declaration
public bool AutomaticInvalidate { get; set; }
Property Value
System.Boolean
|
AutomaticTextureSize
Gets or sets a value indicating whether automatically update size of texture when control dimensions gets changed.
Declaration
[EditorOrder(10)]
[Tooltip("If checked, size of the texture will be automatically updated when control dimensions gets changed.")]
public bool AutomaticTextureSize { get; set; }
Property Value
System.Boolean
|
Texture
Gets the texture with cached children controls.
Declaration
public GPUTexture Texture { get; }
Property Value
GPUTexture
|
TextureSize
Gets or sets the size of the texture (in pixels).
Declaration
[EditorOrder(20)]
[VisibleIf("CanEditTextureSize", false)]
[Limit(0F, 4096F, 1F)]
[Tooltip("The size of the texture (in pixels).")]
public Float2 TextureSize { get; set; }
Property Value
Float2
|
Methods
Draw()
Draw the control and the children.
Declaration
public override void Draw()
Overrides
Invalidate()
Invalidates the cached image of children controls and invokes the redraw to the texture.
Declaration
[Tooltip("Invalidates the cached image of children controls and invokes the redraw to the texture.")]
public void Invalidate()
OnChildrenChanged()
Called when children collection gets changed (child added or removed).
Declaration
public override void OnChildrenChanged()
Overrides
OnChildResized(Control)
Called when child control gets resized.
Declaration
public override void OnChildResized(Control control)
Parameters
Control
control
The resized control. |
Overrides
OnDestroy()
Method called when managed instance should be destroyed
Declaration
public override void OnDestroy()
Overrides
OnSizeChanged()
Called when control size gets changed.
Declaration
protected override void OnSizeChanged()
Overrides
PerformLayoutBeforeChildren()
Perform layout for that container control before performing it for child controls.
Declaration
protected override void PerformLayoutBeforeChildren()