[20:7] extends: Animatable
Wraps FXGL's Entity, the core game-object type in the ECS. Each Entity holds a position (Point2D), rotation, scale, opacity, an arbitrary "type" tag (for collision-handler dispatch), an attached PropertyMap of per-entity variables, and a list of Components that supply its behavior. Aussom users construct Entity directly for ad-hoc setup or get them back from GameWorld.spawn / getEntities. Components extend behavior; see fxgl.Component for the wrapper.
Entity (Ajo = null)
Creates a new empty Entity at (0, 0), or wraps an existing Entity AussomJavaObject when one is supplied. The Java-side wrap path matches the GameWorld / Input / GameScene / PhysicsWorld wrappers so the engine can hand back an Entity wrapper from
wrapAsClass(...)without the no-arg ctor allocating a stray FXGL Entity.
Ajo is an optional AussomJavaObject around an Entity.adopt (object Ajo)
Wraps an existing Entity AussomJavaObject.
Ajo is an AussomJavaObject around an Entity.A new wrapper.getX ()
Returns the entity's X coordinate.
A double.getY ()
Returns the entity's Y coordinate.
A double.setX (double X)
Sets the entity X coordinate.
X is a double.this objectsetY (double Y)
Sets the entity Y coordinate.
Y is a double.this objectsetPosition (double X, double Y)
Sets the entity position (X, Y).
X is the new X.Y is the new Y.this objecttranslate (double Dx, double Dy)
Moves the entity by (Dx, Dy).
Dx is the X delta.Dy is the Y delta.this objectgetRotation ()
Returns the entity rotation in degrees.
A double.setRotation (double Degrees)
Sets the entity rotation in degrees.
Degrees is a double.this objectrotateBy (double Degrees)
Rotates the entity by the given delta in degrees.
Degrees is the delta.this objectsetScaleUniform (double Scale)
Sets the entity uniform scale.
Scale is the scale factor.this objectsetOpacity (double Opacity)
Sets the entity opacity in the range 0.0 to 1.0.
Opacity is the new opacity.this objectsetZIndex (int Z)
Sets the entity z-index (rendering order).
Z is the z-index.this objectgetType ()
Returns the entity type tag (often a string or enum used by collision handlers and queries).
The type as a Java Serializable (string or enum), wrapped as an AussomJavaObject.setType (Type)
Sets the entity type tag.
Type is the type value (string, enum, etc).this objectisType (Type)
Returns whether this entity matches the given type.
Type is the type to compare against.A bool.getProperties ()
Returns the entity's PropertyMap of game variables.
A PropertyMap wrapper.addComponent (object ComponentObj)
Adds a Component to the entity.
ComponentObj is a Component wrapper (or AussomJavaObject around a raw FXGL Component).this objectaddBoundingBox (double Width, double Height)
Adds an axis-aligned box hit box of the given size to the entity's bounding-box component. Required (along with a CollidableComponent) for the entity to participate in collision detection.
Width is the box width in pixels.Height is the box height in pixels.this objectaddViewNode (object NodeObj)
Attaches a visual JavaFX Node to the entity's ViewComponent. This is how an entity becomes visible -- without a view node the entity has a position but renders nothing. The node is positioned relative to the entity and entity transforms apply by default.
NodeObj is a wrapper exposing the node via .obj (any fx.Rectangle, fx.Circle, fx.ImageView, etc.).this objectremoveViewNode (object NodeObj)
Removes a visual Node previously added with addViewNode.
NodeObj is the same wrapper passed to addViewNode.this objectclearViewNodes ()
Removes every visual Node from the entity's view.
this objectremoveComponentByClass (string ClassName)
Removes the component of the given Java class type.
ClassName is the fully qualified component class name.A bool, true if removed.hasComponentByClass (string ClassName)
Returns whether the entity has a component of the given Java class type.
ClassName is the fully qualified component class name.A bool.isColliding (object Other)
Returns whether the entity is currently colliding with another.
Other is an Entity wrapper.A bool.distance (object Other)
Returns the Euclidean distance between this entity's anchor point and another's.
Other is an Entity wrapper.A double.getWidth ()
Returns the entity width (from bounding-box).
A double.getHeight ()
Returns the entity height (from bounding-box).
A double.isActive ()
Returns whether the entity is active (attached to a GameWorld).
A bool.removeFromWorld ()
Removes the entity from its GameWorld.
this object_optAjo (rawAjo)
getPosition ()
Returns the entity position as an AussomJavaObject around a Point2D. Read components via .invoke("getX") / .invoke("getY").
An AussomJavaObject around a Point2D.getCenter ()
Returns the entity center point as an AussomJavaObject around a Point2D. Center is computed from bbox; without a bbox component this returns the entity position.
An AussomJavaObject around a Point2D.getScaleX ()
Returns the entity's X scale.
A double.getScaleY ()
Returns the entity's Y scale.
A double.setScaleX (double X)
Sets the entity's X scale.
X is the scale factor.this objectsetScaleY (double Y)
Sets the entity's Y scale.
Y is the scale factor.this objecttranslateTowards (double Tx, double Ty, double Distance)
Translates the entity toward the given point by the supplied distance.
Tx is the target X.Ty is the target Y.Distance is the distance to translate.this objectrotateToVector (double Vx, double Vy)
Rotates the entity to face along the given vector.
Vx is the vector X.Vy is the vector Y.this objectgetRightX ()
Returns the right edge X of the entity's bounding box.
A double.getBottomY ()
Returns the bottom edge Y of the entity's bounding box.
A double.distanceBBox (object Other)
Returns the bounding-box-relative distance to another entity. Faster and more useful than distance() for collision-radius checks.
Other is an Entity wrapper.A double.setVisible (bool Visible)
Sets whether the entity is visible.
Visible is a bool.this objectisVisible ()
Returns whether the entity is currently visible.
A bool.getOpacity ()
Returns the entity opacity (0.0 - 1.0).
A double.setOnActive (callback Cb)
Sets a callback to fire when the entity becomes active (is added to a GameWorld).
Cb is a callback with no arguments.this objectsetOnNotActive (callback Cb)
Sets a callback to fire when the entity becomes inactive (is removed from a GameWorld).
Cb is a callback with no arguments.this objectgetComponent (string ClassName)
Returns the component instance of the named Java class.
ClassName is the fully qualified component class name.An AussomJavaObject around the Component.getComponentOptional (string ClassName)
Returns the component instance of the named Java class, or null if not attached.
ClassName is the fully qualified component class name.An AussomJavaObject around the Component, or null.getComponents ()
Returns the entity's attached components as an AussomJavaObject around a Java List
.
An AussomJavaObject around a ListgetViewComponent ()
Returns the entity's ViewComponent as an AussomJavaObject.
An AussomJavaObject around the ViewComponent.getBoundingBoxComponent ()
Returns the entity's BoundingBoxComponent.
An AussomJavaObject around the BoundingBoxComponent.addHitBox (object HitBoxObj)
Adds a HitBox (built via BoundingShape factories) to the entity's bounding box.
HitBoxObj is an AussomJavaObject around a HitBox.this objectremoveHitBox (string Name)
Removes a HitBox by name.
Name is the HitBox name.this objectgetPropertyOptional (string Key)
Returns the optional property value (or null if missing).
Key is the property name.The value or null.setProperty (string Key, Value)
Sets a property on the entity's PropertyMap.
Key is the property name.Value is the value to store.this objectgetInt (string Key)
Returns the int property at Key.
Key is the property name.An int.getDouble (string Key)
Returns the double property at Key.
Key is the property name.A double.getBool (string Key)
Returns the bool property at Key.
Key is the property name.A bool.getString (string Key)
Returns the string property at Key.
Key is the property name.A string.getObject (string Key)
Returns the object property at Key.
Key is the property name.An AussomJavaObject.call (string MethodName, list Args)
Forwards a method call to one of the entity's components (whichever has a matching method). Wraps Entity.call.
MethodName is the component method to invoke.Args is a list of arguments.The method's return value (wrapped).setScaleOrigin (double X, double Y)
Sets the scale pivot point in 2D space.
X is the pivot X.Y is the pivot Y.this objectsetScaleOrigin3D (double X, double Y, double Z)
Sets the scale pivot point in 3D space.
X is the pivot X.Y is the pivot Y.Z is the pivot Z.this objectsetRotationOrigin (double X, double Y)
Sets the rotation pivot point in 2D space.
X is the pivot X.Y is the pivot Y.this objectsetRotationOrigin3D (double X, double Y, double Z)
Sets the rotation pivot point in 3D space.
X is the pivot X.Y is the pivot Y.Z is the pivot Z.this objectgetRotationOrigin ()
Returns the 2D rotation pivot point as a Point2D AJO. Convenience pass-through to the TransformComponent since FXGL's Entity does not delegate this getter directly.
getRotationOrigin3D ()
Returns the 3D rotation pivot point as a Point3D AJO. Convenience pass-through to the TransformComponent since FXGL's Entity does not delegate this getter directly.
setLocalAnchor (double X, double Y)
Sets the local anchor point that getAnchoredPosition and setPosition use as the entity's reference point.
X is the anchor X.Y is the anchor Y.this objectsetLocalAnchorFromCenter ()
Convenience that sets the local anchor to the entity's geometric center (from the bounding box).
this objectgetView ()
Returns the single primary view Node attached to the entity (the first node of the ViewComponent's children list), or null when no view has been attached.
An AussomJavaObject around a javafx.scene.Node or null.setView (object NodeObj)
Replaces every view node with the supplied Node. Useful for "make this entity look like this single sprite" wiring.
NodeObj is a fx.Node wrapper.this objectgetTypeComponent ()
Returns the entity's TypeComponent as an AussomJavaObject so callers can bind the value property or compare types polymorphically.
An AussomJavaObject around the TypeComponent.getWorld ()
Returns the GameWorld this entity is attached to (or null).
isEverUpdated ()
True when this entity's update tick is enabled.
setEverUpdated (bool Value)
Toggles per-tick updates for this entity.
Value is a bool: false to skip update calls.this objectsetUpdateEnabled (bool Value)
Enables or disables the entity's update logic (separate from isActive).
Value is a bool.this objectisReusable ()
True when this entity is reusable (returned to a pool on removal).
setReusable (bool Value)
Marks this entity reusable.
Value is a bool.this objectgetLocalAnchor ()
Returns the local anchor offset (Point2D AJO).
getAnchoredPosition ()
Returns the anchored position (no-arg variant; Point2D AJO).
setAnchoredPosition (double X, double Y)
Sets the entity's position so the local anchor lands at the given (x, y).
X is the target world x.Y is the target world y.this objectgetZ ()
Returns the entity's Z coordinate.
setZ (double Z)
Sets the entity's Z coordinate.
Z is the new z.this objectgetScaleZ ()
Returns the entity's Z scale factor.
setScaleZ (double ScaleZ)
Sets the entity's Z scale factor.
ScaleZ is the new scale.this objectgetPosition3D ()
Returns the 3D position (Point3D AJO).
setPosition3D (double X, double Y, double Z)
Sets the 3D position from explicit x/y/z.
this objecttranslate3D (double Dx, double Dy, double Dz)
Translates the entity by the given delta on each axis.
translateX (double Dx)
Translates the entity along X.
translateY (double Dy)
Translates the entity along Y.
translateZ (double Dz)
Translates the entity along Z.
getZIndex ()
Returns the entity's Z-index (rendering order).
isWithin (double X, double Y, double W, double H)
True when this entity's bounding box overlaps the given rectangle. Java's signature takes a
javafx.geometry.Rectangle2D; this wrapper accepts (x, y, w, h) and builds the Rectangle2D AJO on the fly for caller convenience.
addComponentListener (object ListenerAjo)
Registers a ComponentListener AJO. Returns the AJO so the caller can pass it back to removeComponentListener.
ListenerAjo is an AJO around a ComponentListener.The listener AJO.removeComponentListener (object ListenerAjo)
Removes a previously registered ComponentListener.
ListenerAjo is the listener AJO returned by add.this objectgetTransformComponent ()
Returns the entity's TransformComponent AJO (position + rotation + scale).
An AussomJavaObject around the TransformComponent.copy ()
Returns a copy of this entity (per the Animatable contract).
activeProperty ()
Returns the active ReadOnlyBooleanProperty AJO.
typeProperty ()
Returns the type ObjectProperty AJO.
xProperty ()
Returns the x DoubleProperty AJO.
yProperty ()
Returns the y DoubleProperty AJO.
zProperty ()
Returns the z DoubleProperty AJO.
rotationXProperty ()
Returns the rotation-X DoubleProperty AJO.
rotationYProperty ()
Returns the rotation-Y DoubleProperty AJO.
rotationZProperty ()
Returns the rotation-Z DoubleProperty AJO (the 2D angle).
scaleXProperty ()
Returns the scaleX DoubleProperty AJO.
scaleYProperty ()
Returns the scaleY DoubleProperty AJO.
scaleZProperty ()
Returns the scaleZ DoubleProperty AJO.
widthProperty ()
Returns the width DoubleProperty AJO.
heightProperty ()
Returns the height DoubleProperty AJO.
angleProperty ()
Returns the angle DoubleProperty AJO (alias for rotation).
opacityProperty ()
Returns the opacity DoubleProperty AJO.