Package nl.colorize.multimedialib.stage
Class Primitive
java.lang.Object
nl.colorize.multimedialib.stage.Primitive
- All Implemented Interfaces:
StageNode2D
Draws a graphical primitive to the screen. The on-screen position of the
primitive is determined by both the coordinates in the original shape and
by the primitive's position.
Primitives have a stroke property, but its value is only used if
the instance describes an outline shape. The stroke property has no effect
for filled shapes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled by the renderer at the end of frame updates, while rendering the stage.getColor()Returns this node's global transform, which is interpreted relative to the stage.getShape()Returns the bounding box currently occopied by this node, relative to the stage.floatReturns this node's local transform, which is interpreted relative to its parent node.voidvoidsetGlobalTransform(Transform globalTransform) voidvoidsetStroke(float stroke) voidsetTransform(Transform transform) toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface nl.colorize.multimedialib.stage.StageNode2D
setPosition
-
Constructor Details
-
Primitive
-
Primitive
-
-
Method Details
-
getStageBounds
Description copied from interface:StageNode2DReturns the bounding box currently occopied by this node, relative to the stage. This method usesStageNode2D.getGlobalTransform().- Specified by:
getStageBoundsin interfaceStageNode2D
-
animate
Description copied from interface:StageNode2DCalled by the renderer at the end of frame updates, while rendering the stage.animationTimercontains the elapsed time since the currently active scene was started. This allows animations to display correctly, without the need to update every single node during each frame update.- Specified by:
animatein interfaceStageNode2D
-
toString
-
getTransform
Description copied from interface:StageNode2DReturns this node's local transform, which is interpreted relative to its parent node. The local transform can be modified by application code to modify how and where the node is displayed.- Specified by:
getTransformin interfaceStageNode2D
-
getGlobalTransform
Description copied from interface:StageNode2DReturns this node's global transform, which is interpreted relative to the stage. The global transform is updated by the renderer when drawing the stage at the end of frame updates. Recalculating the global transform is relatively expensive, and is therefore only done once per frame. This means that any changes made to a node's local transform since the last frame update may not yet been reflected in the current state of its global transform.- Specified by:
getGlobalTransformin interfaceStageNode2D
-
getShape
-
getColor
-
getStroke
public float getStroke() -
setTransform
-
setGlobalTransform
-
setShape
-
setColor
-
setStroke
public void setStroke(float stroke)
-