Available with arcade plugin
The arcade physics body bound to this visual.
Available with arcade plugin
The arcade physics body linked to this visual
Available with arcade plugin
Allow this visual to be rotated by arcade physics, via angularVelocity
, etc...
Available with arcade plugin
An immovable visual will not receive any impacts from other visual bodies. Two immovable visuas can't separate or exchange momentum and will pass through each other.
Available with arcade plugin
If set to true
, arcade world will always separate on the X axis before Y when this body is involved. Otherwise it will check gravity totals first.
Available with arcade plugin
The x velocity, or rate of change the visual position. Measured in points per second.
Available with arcade plugin
The y velocity, or rate of change the visual position. Measured in points per second.
Available with arcade plugin
The maximum x velocity that the visual can reach.
Available with arcade plugin
The maximum y velocity that the visual can reach.
Available with arcade plugin
The x acceleration is the rate of change of the x velocity. Measured in points per second squared.
Available with arcade plugin
The y acceleration is the rate of change of the y velocity. Measured in points per second squared.
Available with arcade plugin
Allow this visual to be influenced by drag
Available with arcade plugin
The x drag is the rate of reduction of the x velocity, kind of deceleration. Measured in points per second squared.
Available with arcade plugin
The y drag is the rate of reduction of the y velocity, kind of deceleration. Measured in points per second squared.
Available with arcade plugin
The x elasticity of the visual when colliding. bounceX = 1
means full rebound, bounceX = 0.5
means 50% rebound velocity.
Available with arcade plugin
The y elasticity of the visual when colliding. bounceY = 1
means full rebound, bounceY = 0.5
means 50% rebound velocity.
Available with arcade plugin
Enable or disable world bounds specific bounce value with worldBounceX
and worldBounceY
.
Disabled by default, meaning bounceX
and bounceY
are used by default.
Available with arcade plugin
The x elasticity of the visual when colliding with world bounds. Ignored if useWorldBounce
is false
(bounceX
used instead).
Available with arcade plugin
The y elasticity of the visual when colliding with world bounds. Ignored if useWorldBounce
is false
(bounceY
used instead).
Available with arcade plugin
The maximum x delta per frame. 0
(default) means no maximum delta.
Available with arcade plugin
The maximum y delta per frame. 0
(default) means no maximum delta.
Available with arcade plugin
Allow this visual to be influenced by gravity, either world or local.
Available with arcade plugin
This visual's local y gravity, added to any world gravity, unless allowGravity
is set to false.
Available with arcade plugin
This visual's local x gravity, added to any world gravity, unless allowGravity
is set to false.
Available with arcade plugin
If this visual is immovable
and moving, and another visual body is 'riding' this one, this is the amount of motion the riding body receives on x axis.
Available with arcade plugin
If this visual is immovable
and moving, and another visual body is 'riding' this one, this is the amount of motion the riding body receives on y axis.
Available with arcade plugin
The angular velocity is the rate of change of the visual's rotation. It is measured in degrees per second.
Available with arcade plugin
The maximum angular velocity in degrees per second that the visual can reach.
Available with arcade plugin
The angular acceleration is the rate of change of the angular velocity. Measured in degrees per second squared.
Available with arcade plugin
The angular drag is the rate of reduction of the angular velocity. Measured in degrees per second squared.
Available with arcade plugin
The mass of the visual's body. When two bodies collide their mass is used in the calculation to determine the exchange of velocity.
Available with arcade plugin
The speed of the visual's body (read only). Equal to the magnitude of the velocity.
Available with arcade plugin
Whether the physics system should update the visual's position and rotation based on its velocity, acceleration, drag, and gravity.
Available with arcade plugin
When this visual's body collides with another, the amount of overlap (x axis) is stored here.
Available with arcade plugin
When this visual's body collides with another, the amount of overlap (y axis) is stored here.
Available with arcade plugin
If a visual's body is overlapping with another body, but neither of them are moving (maybe they spawned on-top of each other?) this is set to true
.
Available with arcade plugin
A visual body can be set to collide against the world bounds automatically and rebound back into the world if this is set to true. Otherwise it will leave the world.
When enabled, this visual will receive as many up/down/click/over/out events as
there are fingers or mouse pointer interacting with it.
Default is false
, ensuring there is never multiple up/down/click/over/out that
overlap each other. In that case, it triggers pointer down
when the first finger/pointer hits
the visual and trigger pointer up
when the last finger/pointer stops touching it. Behavior is
similar for pointer over
and pointer out
events.
Whether this visual is between a pointer down
and an pointer up
event or not.
Whether this visual is between a pointer over
and an pointer out
event or not.
@:value(null)clip:Visual = null
Use the given visual's bounds as clipping area for itself and every children.
Clipping areas cannot be combined. That means if clip
is not null and current
visual instance is already clipped by a parent visual, its children's won't be clipped
by it anymore as they are instead clipped by this clip
property instead.
Whether this visual should inherit its parent alpha value or not.
If it inherits, parent alpha value will be multiplied with current visual's own alpha
property.
Computed flag that tells whether this visual is only translated,
thus not rotated, skewed nor scaled.
When this is true
, matrix computation may be a bit faster as it
will skip some unneeded matrix computation.
Whether we should re-check if this visual is only translating or having a more complex transform
Setting this to true will force the visual to recompute its displayed content
Setting this to true will force the visual's matrix to be re-computed
Setting this to true will force the visual's computed render target to be re-computed
Setting this to true will force the visual to compute it's visility in hierarchy
Setting this to true will force the visual to compute it's touchability in hierarchy
Setting this to true will force the visual to compute it's clipping state in hierarchy
If set, the visual will be rendered into this target RenderTexture instance
instead of being drawn onto screen directly.
@:value(true)@editable({ group : "active" })visible:Bool = true
Set to false
to make this visual (and all of its children) invisible and not rendered.
@:value(true)@editable({ group : "active" })touchable:Bool = true
Set to false
to make this visual (and all of its children) not touchable
@:value(0)@editable({ group : "depth" })depth:Float = 0
Set this visual's depth.
Visuals are rendered from back to front of the screen.
Given two visuals, a visual with higher depth will be rendered above a visual with lower depth.
In practice, it is advised to use integer values like 1
, 2
, 3
... to order your visuals,
like you would do with z-index on CSS elements.
@:value(1)@editable({ group : "depth", label : "Range" })depthRange:Float = 1
If set to 1
(default), children will be sort by depth and their computed depth
will be within range [parent.depth, parent.depth + depthRange].
You'll usually won't need to change this value,
unless you want to do advanced drawing where different
hierarchies of visuals are blending with each other.
// Children computed depths will be relative to their parent visual depth.
// This is the default value and recommended approach in most situations as
// its behaviour is similar to display trees, z-index etc...
visual.depthRange = 1;
// More advanced, two visuals: visual2 above visual1 because of higher depth, but
// visual1's depth range is `8`, so its children computed depths will be distributed
// between `1` and `1 + 8` (9 excluded). That means some of visual1's children
// can be above visual2's children. Can be useful on some specific edge cases,
// but not recommended in general.
visual1.depthRange = 8;
visual1.depth = 1;
visual2.depth = 2;
// Another case: two visuals with the same depth and depthRange.
// There children will share the same computed depth space, so a child of visual1 at `depth = 6`
// will be above a child of visual2 at `depth = 4`.
// Resulting computed depths will be between `1` and `1 + 16` (17 excluded).
visual1.depthRange = 16
visual2.depthRange = 16
visual1.depth = 1;
visual2.depth = 1;
// Children computed depths won't be relative to their parent visual depth.
// Instead, it will be relative to the higher parent (of the parent) in hierarchy that has a positive `depthRange` value,
visual.depthRange = -1;
@:value(0)@editable({ group : "position" })x:Float = 0
The x position of this visual.
Relative to its parent, or screen if this visual has no parent.
@:value(0)@editable({ group : "position" })y:Float = 0
The y position of this visual.
Relative to its parent, or screen if this visual has no parent.
@:value(1)@editable({ group : "scale" })scaleX:Float = 1
The scaleX value of this visual.
@:value(1)@editable({ group : "scale" })scaleY:Float = 1
The scaleY value of this visual.
@:value(0)@editable({ group : "skew" })skewX:Float = 0
The skewX value of this visual.
@:value(0)@editable({ group : "skew" })skewY:Float = 0
The skewY value of this visual.
@:value(0)@editable({ group : "anchor" })anchorX:Float = 0
The anchorX value of this visual.
Affects how position, scale, rotation and skew of the visual are rendered.
Default is 0
, which means: anchor relative to the left of the visual.
Use 1
to make it relative to the right of the visual, or 0.5
to make it
relative to the horizontal center of the visual.
@:value(0)@editable({ group : "anchor" })anchorY:Float = 0
The anchorY value of this visual.
Affects how position, scale, rotation and skew of the visual are rendered.
Default is 0
, which means: anchor relative to the top of the visual.
Use 1
to make it relative to the bottom of the visual, or 0.5
to make it
relative to the vertical center of the visual.
@editable({ min : 0, group : "size" })width:Float
The width of the visual.
Default is 0
. Can be set to an explicit value.
Some subclasses of Visual
are computing it automatically
like Text
from its textual content or Quad
when a texture is assigned to it.
@editable({ min : 0, group : "size" })height:Float
The height of the visual.
Default is 0
. Can be set to an explicit value.
Some subclasses of Visual
are computing it automatically
like Text
from its textual content or Quad
when a texture is assigned to it.
If set to a value above zero, matrix translation (tx & ty) will be rounded.
roundTranslation = 0; // No rounding (default)
roundTranslation = 1; // Pixel perfect rounding
roundTranslation = 2; // Half-pixel rounding
May be useful to render pixel perfect scenes onto ceramic.Filter
.
@:value(0)@editable({ slider : [0, 360], degrees : true })rotation:Float = 0
Rotation of the visual in degrees.
The center of the rotation depends on anchorX
and anchorY
.
@:value(1)@editable({ slider : [0, 1] })alpha:Float = 1
Alpha of the visual. Must be a value between 0
(transparent) and 1
(fully opaque)
@editable({ group : "translate" })translateX:Float
Visual X translation.
This is a shorthand equivalent to assigning a Transform
object to
the visual with a tx
value of translateX
.
Only recommended for advanced usage as x
property should be used in general instead.
@editable({ group : "translate" })translateY:Float
Visual Y translation.
This is a shorthand equivalent to assigning a Transform
object to
the visual with a ty
value of translateY
.
Only recommended for advanced usage as y
property should be used in general instead.
Set additional matrix-based transform to this visual. Default is null
.
A Transform
object will affect of the visual is rendered.
The transform is applied after visual's properties (position, rotation, scale, skew).
@:value(null)@editableshader:Shader = null
Assign a shader to this visual.
When none is assigned, default shader will be used.
Whether this visual is active
. Default is true. When setting it to false,
the visual won't be visible
nor touchable
anymore (these get set to false).
When restoring active
to true, visible
and touchable
will also get back
their previous state.
If you want to keep a visual around without it being displayed or interactive, simply
set its active
property to false
. It will be almost like it doesn't exist and its
impact on rendering will be minimal.
Computed visible value. This is true
if this visual is visible
and all
of its parents are visible
. If you want to know if a visual is visible on screen,
you should check with this property and not visible
property, which doesn't account
for parent visibility.
Computed alpha value. This is the combination of this visual's alpha and its parent alpha
if inheritAlpha
is true
Computed depth value. This is the final depth used by rendering, computed from this visual's depth
and depthRange
properties and its hierarchy of parent visuals.
Computed render target. When a visual has a renderTarget
assigned, its computedRenderTarget
will
be assigned with the same instance, and its children's computedRenderTarget
property as well.
Computed touchable value. This is true
if this visual is touchable
and all
of its parents are touchable
.
If any parent of this visual has a clip
visual assigned, this will be the computed/resolved visual.
A visual can have children.
Children positions and transformations are relative to their parent.
This property is read only. Use add()
to add children to this visual
and remove()
to remove them.
The order on the visuals in children
should not be used to predict the order in which visuals are rendered.
If you want to control the order of rendering of visuals, use depth
property on the children instead.
@:value(null)read onlyparent:Visual = null
The parent visual if there is any, or null
if this visual doesn't have any parent.
Available with nape plugin
The nape physics (body) of this visual.