class
Component
package haxe.ui.core
Known Subclasses: | Canvas, HGrid, Image, Label, Rule, Spacer, Switch, TabBar, VGrid, Box, MenuSeparator, TabView, InteractiveComponent |
Base class of all HaxeUI controls
animatable:Bool
Whether this component is allowed to animate or not.
componentAnimation:Animation
The currently running animation.
componentTabIndex:Int
cssName:String
dragInitiator:Component
dragOptions:
draggable:Bool
When set to true, this component should be drag&drop-able.
isComponentSolid:Bool
Whether this component has a non-visible graphic added/drawn onto it or not.
native:Null<Bool>
When enabled, HaxeUI will try to use a native version of this component.
screen:Screen
The Screen object this component is displayed on.
styleSheet:StyleSheet
userData::Dynamic
Can be used to store specific data relating to the component, or other things in your application.
className:String
actualComponentHeight:Float
The component's true height on screen.
May differ from componentHeight if Toolkit.scaleY != 1
May differ from componentHeight if Toolkit.scaleY != 1
actualComponentWidth:Float
The component's true width on screen.
May differ from componentWidth if Toolkit.scaleX != 1
May differ from componentWidth if Toolkit.scaleX != 1
componentClipRect:Rectangle
When set to a non-null value, restricts the component's "rendering zone"
to only render inside the bounds of the given rectangle, effectively "clipping" the component.
to only render inside the bounds of the given rectangle, effectively "clipping" the component.
hasScreen:Bool
Whether this component, or one if it's parents, has a screen.
isComponentClipped:Bool
Whether this component has a non-null clipping rectangle or not.
isComponentOffscreen:Bool
true if this component's area intersects with the screen, false otherwise.
clipRect is not taken into consideration - that means, if a clipRect turns a component from being
visible on screen to being invisible on screen, isComponentOffScreen should still be false.
clipRect is not taken into consideration - that means, if a clipRect turns a component from being
visible on screen to being invisible on screen, isComponentOffScreen should still be false.
cloneComponent():Component
Gets a complete copy of this component.
Returns
A new component, similar to this one. |
disposeComponent():Void
Removes this component from memory.
Calling methods/using fields on this component after calling disposeComponent
is undefined behaviour, and could result in a null pointer exception/x is null exceptions.
Calling methods/using fields on this component after calling disposeComponent
is undefined behaviour, and could result in a null pointer exception/x is null exceptions.
fadeIn(onEnd:():Void = null, show:Bool = true):Void
Applies a fade effect which turns this component from invisible to visible.
Parameters
onEnd:():Void = null | A function to dispatch when the fade completes |
show:Bool = true | When enabled, ensures that this component is actually visible when the fade completes. |
fadeOut(onEnd:():Void = null, hide:Bool = true):Void
Applies a fade effect which turns this component from visible to invisible.
Parameters
onEnd:():Void = null | A function to dispatch when the fade completes |
show:Bool = true | When enabled, ensures that this component is actually invisible when the fade completes. |
findComponents<T>(styleName:String = null, type:Class<T> = null, maxDepth:Int = 5):Array<T>
Finds all components with a specific style in this components display tree.
Parameters
styleName:String = null | The style name to search for |
type:Class<T> = null | The component class you wish to cast the result to (defaults to null, which means casting to the default, Component type). |
maxDepth:Int = 5 | how many children "deep" should the search go to find components. defaults to 5. |
Returns
An array of the found components. |
findComponentsUnderPoint<T>(screenX:Float, screenY:Float, type:Class<T> = null):Array<Component>
Lists components under a specific point in global, screen coordinates.
Note: this function will return *every single* components at a specific point,
even if they have no backgrounds, or haven't got anything drawn onto them.
Note: this function will return *every single* components at a specific point,
even if they have no backgrounds, or haven't got anything drawn onto them.
Parameters
screenX:Float | The global, on-screen x position of the point to check for components under |
screenY:Float | The global, on-screen y position of the point to check for components under |
type:Class<T> = null | Used to filter all components that aren't of a specific type. null by default, which means no filter is applied. |
Returns
An array of all components that overlap the "global" position (x, y) |
hasComponentUnderPoint<T>(screenX:Float, screenY:Float, type:Class<T> = null):Bool
Finds out if there is a component under a specific point in global coordinates.
Parameters
screenX:Float | The global, on-screen x position of the point to check for components under |
screenY:Float | The global, on-screen y position of the point to check for components under |
type:Class<T> = null | Used to filter all components that aren't of a specific type. null by default, which means no filter is applied. |
Returns
true if there is a component that overlaps the global position (x, y), false otherwise. |
lockLayout(recursive:Bool = false):Void
ready():Void
Tells the framework this component is ready to render
*Note*: this is called internally by the framework
*Note*: this is called internally by the framework
unlockLayout(recursive:Bool = false):Void
walkComponents(callback::Component->Bool):Void
Iterates over the children components and calls callback() on each of them, recursively.
The children's children are also included in the walking, and so are those children's children...
The children's children are also included in the walking, and so are those children's children...
Parameters
callback::Component->Bool | a callback that receives one component, and returns whether the walking should continue or not. |
pauseEvent(type:String, recursive:Bool = false):Void
resumeEvent(type:String, recursive:Bool = false):Void
hidden:Bool
Whether this component is visible or not.
numComponents:Int
Gets the number of children added to this component.
rootComponent:Component
The top-level component of this component's parent tree.
onAnimationEnd:AnimationEvent->Void
onAnimationFrame:AnimationEvent->Void
onAnimationStart:AnimationEvent->Void
onChange:UIEvent->Void
onClick:MouseEvent->Void
onDblClick:MouseEvent->Void
onDrag:DragEvent->Void
onDragEnd:DragEvent->Void
onDragStart:DragEvent->Void
onMouseOut:MouseEvent->Void
onMouseOver:MouseEvent->Void
onRightClick:MouseEvent->Void
includeInLayout:Bool
Whether to use this component as part of its part layout
Note*: invisible components are not included in parent layouts
Note*: invisible components are not included in parent layouts
layout:Layout
The layout of this component
left:Null<Float>
The position of this component on the horizontal, x-axis.
This position is relative to this component's parent.
This position is relative to this component's parent.
screenLeft:Float
The **on-screen** position of this component on the horizontal, x-axis.
screenTop:Float
The **on-screen** position of this component on the vertical, y-axis.
top:Null<Float>
The position of this component on the vertical, y-axis.
This position is relative to this component's parent.
This position is relative to this component's parent.
namedComponents:Array<Component>
scriptAccess:Bool
autoHeight:Bool
When enabled, this component will automatically resize itself based on it's children's calculated height.
For example, if this component's padding is 5, and it has one child, 200 pixels tall,
and autoHeight is set to true, this component's height should be 210
For example, if this component's padding is 5, and it has one child, 200 pixels tall,
and autoHeight is set to true, this component's height should be 210
autoWidth:Bool
When enabled, this component will automatically resize itself based on it's children's calculated width.
For example, if this component's padding is 5, and it has one child, 150 pixels wide,
and autoWidth is set to true, this component's width should be 160
For example, if this component's padding is 5, and it has one child, 150 pixels wide,
and autoWidth is set to true, this component's width should be 160
height:Null<Float>
This component's height. similar to componentHeight
percentHeight:Null<Float>
When set, sets this component's height to be percentHeight% percent of it's parent's height.
percentWidth:Null<Float>
When set, sets this component's width to be percentWidth% percent of it's parent's width.
width:Null<Float>
This component's width. similar to componentWidth
backgroundColor:Null<Color>
backgroundColorEnd:Null<Color>
backgroundImage:Variant
borderColor:Null<Color>
borderRadius:Null<Float>
borderSize:Null<Float>
clip:Null<Bool>
color:Null<Color>
horizontalAlign:String
marginBottom:Null<Float>
marginLeft:Null<Float>
marginRight:Null<Float>
marginTop:Null<Float>
opacity:Null<Float>
padding:Null<Float>
paddingBottom:Null<Float>
paddingLeft:Null<Float>
paddingRight:Null<Float>
paddingTop:Null<Float>
verticalAlign:String
customStyle:Style
A custom style object that will applied to this component after any css rules have been matched and applied.
Use this when modifying this component's style through code.
Use this when modifying this component's style through code.
styleNames:String
styleString:String
Used to parse an apply an inline css string to this component as a custom style.
style:Style
The calculated style of this component