Class Widget
- Namespace
- Lime
- Assembly
- Lime.dll
Base class for any rendered object.
[TangerineVisualHintGroup("/All/Nodes/Containers", null)]
public class Widget : Node, IDisposable, IAnimatorHost, IRenderChainBuilder, IAnimable, ICloneable
- Inheritance
-
Widget
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
Widget()
public Widget()
Fields
BoneArray
public BoneArray BoneArray
Field Value
DefaultWidgetSize
public static readonly Vector2 DefaultWidgetSize
Field Value
EnableViewCulling
public static bool EnableViewCulling
Field Value
RenderTransparentWidgets
public static bool RenderTransparentWidgets
Field Value
globalBlending
protected Blending globalBlending
Field Value
globalColor
protected Color4 globalColor
Field Value
globalShader
protected ShaderId globalShader
Field Value
globallyEnabled
protected bool globallyEnabled
Field Value
globallyVisible
protected bool globallyVisible
Field Value
Properties
Anchors
[YuzuMember]
[TangerineKeyframeColor(17)]
public Anchors Anchors { get; set; }
Property Value
Blending
[YuzuMember]
[TangerineKeyframeColor(22)]
public Blending Blending { get; set; }
Property Value
BoundingRect
public Rectangle BoundingRect { get; set; }
Property Value
Center
Parent-relative position of center of this widget.
public Vector2 Center { get; }
Property Value
Clicked
public virtual Action Clicked { get; set; }
Property Value
Color
Hue of this widget. Contents color will be multiplied by it on render.
[YuzuMember]
[TangerineKeyframeColor(9)]
[YuzuSerializeIf("IsNotDecorated")]
public Color4 Color { get; set; }
Property Value
ContentHeight
public float ContentHeight { get; }
Property Value
ContentPosition
public Vector2 ContentPosition { get; }
Property Value
ContentSize
public Vector2 ContentSize { get; }
Property Value
ContentWidth
public float ContentWidth { get; }
Property Value
EffectiveMaxSize
public virtual Vector2 EffectiveMaxSize { get; }
Property Value
EffectiveMinSize
public virtual Vector2 EffectiveMinSize { get; }
Property Value
Enabled
public virtual bool Enabled { get; set; }
Property Value
FocusScope
public KeyboardFocusScope FocusScope { get; set; }
Property Value
Focused
public static Widget Focused { get; }
Property Value
FreezeInvisible
[YuzuMember]
[TangerineKeyframeColor(19)]
public bool FreezeInvisible { get; set; }
Property Value
GlobalBlending
Gets the widget's effective blending.
public Blending GlobalBlending { get; }
Property Value
GlobalCenter
Gets position of this widget's center in the root widget space.
public Vector2 GlobalCenter { get; }
Property Value
GlobalColor
Gets the widget's effective color.
public Color4 GlobalColor { get; }
Property Value
GlobalPivotPosition
public Vector2 GlobalPivotPosition { get; }
Property Value
GlobalPosition
Gets position of this widget in the root widget space.
public Vector2 GlobalPosition { get; }
Property Value
GlobalShader
Gets the widget's effective shader.
public ShaderId GlobalShader { get; }
Property Value
GloballyEnabled
Indicates whether the widget is actually enabled.
public bool GloballyEnabled { get; }
Property Value
GloballyVisible
Indicates whether the widget is actually visible.
public bool GloballyVisible { get; }
Property Value
Height
public float Height { get; set; }
Property Value
HitTestMethod
[YuzuMember]
public HitTestMethod HitTestMethod { get; set; }
Property Value
Input
public WidgetInput Input { get; }
Property Value
this[string]
Searches for widget with provided path or id in this widget's descendants. Throws an exception if sought-for widget doesn't exist.
This function is thread safe.
public Widget this[string path] { get; }
Parameters
path
stringId or path of widget. Path can be incomplete (i.e. for path Root/Human/Head/Eye Human or Head can be ommited).
Property Value
this[string, object[]]
Searches for widget with provided path or id in this widget's descendants. Throws an exception if sought-for widget doesn't exist.
This function is thread safe.
public Widget this[string format, params object[] arg] { get; }
Parameters
format
stringId or path of widget. Path can be incomplete (i.e. for path Root/Human/Head/Eye Human or Head can be ommited).
arg
object[]
Property Value
Layout
public ILayout Layout { get; set; }
Property Value
LayoutConstraints
public LayoutConstraints LayoutConstraints { get; set; }
Property Value
LayoutManager
public LayoutManager LayoutManager { get; set; }
Property Value
LocalToWorldTransform
Gets the matrix represents transformation from this widget space into the root widget space.
public Matrix32 LocalToWorldTransform { get; }
Property Value
MaxHeight
public float MaxHeight { get; set; }
Property Value
MaxSize
public Vector2 MaxSize { get; set; }
Property Value
MaxWidth
public float MaxWidth { get; set; }
Property Value
MeasuredMaxSize
public Vector2 MeasuredMaxSize { get; set; }
Property Value
MeasuredMinSize
public Vector2 MeasuredMinSize { get; set; }
Property Value
MinHeight
public float MinHeight { get; set; }
Property Value
MinMaxHeight
public float MinMaxHeight { set; }
Property Value
MinMaxSize
public Vector2 MinMaxSize { set; }
Property Value
MinMaxWidth
public float MinMaxWidth { set; }
Property Value
MinSize
public Vector2 MinSize { get; set; }
Property Value
MinWidth
public float MinWidth { get; set; }
Property Value
Opacity
0 - fully transparent. 1 - fully opaque.
public float Opacity { get; set; }
Property Value
Padding
Gets or sets the widget padding. Padding defines the white space between the widget content and the widget border. The widget presenter and layout should respect the padding.
[Validation.Range(-3.4028235E+38, 3.4028235E+38)]
[YuzuMember]
public Thickness Padding { get; set; }
Property Value
ParentWidget
public Widget ParentWidget { get; }
Property Value
Pivot
Center point of rotation and scaling. (0, 0) is top-left corner, (1, 1) is bottom-right corner.
[YuzuMember]
[TangerineKeyframeColor(6)]
[TangerinePropertyDefaultValue(typeof(Widget), "GetPivotDefaultValue")]
public Vector2 Pivot { get; set; }
Property Value
Position
Parent-relative position.
[YuzuMember]
[TangerineKeyframeColor(4)]
[TangerineNumericEditBoxStep(1)]
public Vector2 Position { get; set; }
Property Value
Rotation
Counter-clockwise rotation of this widget.
[YuzuMember]
[TangerineKeyframeColor(3)]
[TangerineNumericEditBoxStep(1)]
public float Rotation { get; set; }
Property Value
Scale
[YuzuMember]
[TangerineKeyframeColor(5)]
public Vector2 Scale { get; set; }
Property Value
Shader
[YuzuMember]
[TangerineKeyframeColor(18)]
public ShaderId Shader { get; set; }
Property Value
SilentSize
SilentSize is needed to prevent unwanted propagation of OnSizeChanged
while deserializing with Yuzu.
[YuzuMember("Size")]
public Vector2 SilentSize { get; set; }
Property Value
Size
[TangerineKeyframeColor(7)]
[TangerineNumericEditBoxStep(1)]
[Validation.RatioInfo(new Type[] { typeof(Image), typeof(DistortionMesh), typeof(NineGrid) })]
[Validation.SizeInfo(new Type[] { typeof(Image), typeof(DistortionMesh), typeof(NineGrid) })]
public Vector2 Size { get; set; }
Property Value
SkinningWeights
[YuzuMember]
public SkinningWeights SkinningWeights { get; set; }
Property Value
Sprite
Gets or sets a texture upon the widget. For widgets which can not have a texture returns null.
public virtual ISprite Sprite { get; set; }
Property Value
TabTravesable
public TabTraversable TabTravesable { get; set; }
Property Value
Text
Get or sets a label upon the widget. For widgets which can not have a label returns null.
public virtual string Text { get; set; }
Property Value
Visible
[YuzuMember]
[TangerineKeyframeColor(19)]
public bool Visible { get; set; }
Property Value
Width
public float Width { get; set; }
Property Value
X
Parent-relative X position.
public float X { get; set; }
Property Value
Y
Parent-relative Y position.
public float Y { get; set; }
Property Value
Methods
AddToRenderChain(RenderChain)
Adds widget and all its descendants to render chain.
public override void AddToRenderChain(RenderChain chain)
Parameters
chain
RenderChain
BoundingRectHitTest(Vector2)
public bool BoundingRectHitTest(Vector2 point)
Parameters
point
Vector2
Returns
CalcAABBInSpaceOf(Widget)
Calculates the widget's AABB in the space of another widget.
public Rectangle CalcAABBInSpaceOf(Widget widget)
Parameters
widget
Widget
Returns
CalcAABBInViewportSpace(WindowRect, Matrix44)
public IntRectangle CalcAABBInViewportSpace(WindowRect viewport, Matrix44 worldViewProjection)
Parameters
viewport
WindowRectworldViewProjection
Matrix44
Returns
CalcAABBInWindowSpace()
public Rectangle CalcAABBInWindowSpace()
Returns
CalcContentSize()
public virtual Vector2 CalcContentSize()
Returns
CalcGlobalBoundingRect()
Gets the axis-aligned bounding rectangle based on LocalToWorldTransform.
public Rectangle CalcGlobalBoundingRect()
Returns
CalcHull(in Matrix32?)
public Quadrangle CalcHull(in Matrix32? transform = null)
Parameters
transform
Matrix32?
Returns
CalcHullInSpaceOf(Widget)
Calculates the widget's convex hull in the space of another widget.
public Quadrangle CalcHullInSpaceOf(Widget widget)
Parameters
widget
Widget
Returns
CalcLocalToParentTransform()
public Matrix32 CalcLocalToParentTransform()
Returns
CalcPositionInSpaceOf(Widget)
public Vector2 CalcPositionInSpaceOf(Widget widget)
Parameters
widget
Widget
Returns
CalcTransitionToSpaceOf(Widget)
Calculates the widget's transition to the space of another widget.
public Matrix32 CalcTransitionToSpaceOf(Widget widget)
Parameters
widget
Widget
Returns
CenterOnParent()
public void CenterOnParent()
ClipRegionTest(Rectangle)
public bool ClipRegionTest(Rectangle clipRegion)
Parameters
clipRegion
Rectangle
Returns
Dispose()
Stops all tasks and calls Dispose of all descendants.
public override void Dispose()
ExpandToContainerWithAnchors()
public void ExpandToContainerWithAnchors()
GetEffectiveLayer()
public int GetEffectiveLayer()
Returns
GetPivotDefaultValue()
public static object GetPivotDefaultValue()
Returns
GetVisibilityIssues()
public virtual IEnumerable<string> GetVisibilityIssues()
Returns
HasInput()
public bool HasInput()
Returns
IsFocused()
public bool IsFocused()
Returns
IsRenderedToTexture()
protected virtual bool IsRenderedToTexture()
Returns
LocalHitTest(ref HitTestArgs)
Performs hit test only for this widget and its descendants. Returns true if the widget or one of its decendants contains the given point. This method doesn't take in account if one of the widget's ancestors overlaps the widget.
public bool LocalHitTest(ref HitTestArgs args)
Parameters
args
HitTestArgs
Returns
LocalHitTest(Vector2)
Checks whether this widget or one of its descendents contains the given point. This method doesn't take in account if one of the widget's ancestors overlaps the widget.
public bool LocalHitTest(Vector2 point)
Parameters
point
Vector2
Returns
LocalMousePosition()
public Vector2 LocalMousePosition()
Returns
OnParentChanged(Node)
Occurs when Parent property changes.
protected override void OnParentChanged(Node oldParent)
Parameters
oldParent
Node
OnSizeChanged(Vector2)
protected virtual void OnSizeChanged(Vector2 sizeDelta)
Parameters
sizeDelta
Vector2
PartialHitTest(ref HitTestArgs)
Checks whether this widget contains the given point.
protected override bool PartialHitTest(ref HitTestArgs args)
Parameters
args
HitTestArgs
Returns
PartialHitTestByContents(ref HitTestArgs)
protected virtual bool PartialHitTestByContents(ref HitTestArgs args)
Parameters
args
HitTestArgs
Returns
RaiseUpdated(float)
Raises Updated event in respect of animation speed.
public void RaiseUpdated(float delta)
Parameters
delta
floatTime delta from last Update.
RaiseUpdating(float)
Raises Updating event in respect of animation speed.
public void RaiseUpdating(float delta)
Parameters
delta
floatTime delta from last Update.
RecalcBoundingRect()
public void RecalcBoundingRect()
RecalcGloballyFrozen()
protected override void RecalcGloballyFrozen()
RecalcGloballyVisible()
protected virtual void RecalcGloballyVisible()
RefreshLayout()
public void RefreshLayout()
RevokeFocus()
public void RevokeFocus()
SetFocus()
public void SetFocus()
StaticScale(float, bool)
TODO: Add summary
public override void StaticScale(float ratio, bool roundCoordinates)
Parameters
ToLocalMousePosition(Vector2)
public Vector2 ToLocalMousePosition(Vector2 mousePosition)
Parameters
mousePosition
Vector2
Returns
UpdateAncestorBoundingRect(Widget)
public override void UpdateAncestorBoundingRect(Widget ancestor)
Parameters
ancestor
Widget
WasClicked()
public virtual bool WasClicked()