Class Primitive
java.lang.Object
nl.colorize.multimedialib.stage.Primitive
- All Implemented Interfaces:
StageNode, 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.static PrimitivefromCircle(float radius, ColorRGB color) static PrimitivefromCircle(float radius, ColorRGB color, float alpha) static Primitivestatic PrimitivegetColor()Returns this node's global transform, which is interpreted relative to the stage.Returns this node's parent node.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.voidprotected voidvoidvoidsetStroke(float stroke) toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface StageNode2D
detach, 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:StageNodeCalled 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. -
toString
-
fromRect
-
fromRect
-
fromCircle
-
fromCircle
-
getParent
-
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() -
setShape
-
setColor
-
setStroke
public void setStroke(float stroke) -
setParent
-