Interface Sprite
public interface Sprite
The Sprite is the graphical component of an element,
it can be displayed through it's node
-
Method Summary
Modifier and Type Method Description default Coordinates<java.lang.Double>getLayout()Return the component's position (relative to its parent)javafx.scene.NodegetNode()Deprecated.avoid using this elsewhere than in Enginedefault doublegetRotate()Return the angle of the componentdefault ScalegetScale()Return the scale used for the componentdefault DimensiongetSize()Return the component's sizedefault doublegetZOrder()The depth of the componentvoidresize(double width, double height)resize the sprite to the following width and heightdefault voidsetLayout(double x, double y)Set the component's positiondefault voidsetLayout(Coordinates<java.lang.Double> coordinates)default voidsetRotate(double angle)Set the angle at which the component is rotateddefault voidsetScale(double scaleX, double scaleY)Set the component's scaledefault voidsetZOrder(double z)Update the order or depth of the component
-
Method Details
-
getNode
@Deprecated javafx.scene.Node getNode()Deprecated.avoid using this elsewhere than in EngineThe Sprite object- Returns:
- the Sprite object
-
resize
void resize(double width, double height)resize the sprite to the following width and height- Parameters:
width-height-
-
setLayout
default void setLayout(double x, double y)Set the component's position- Parameters:
x- positiony- position
-
setLayout
-
setScale
default void setScale(double scaleX, double scaleY)Set the component's scale- Parameters:
scaleX- x scalescaleY- y scale
-
getScale
Return the scale used for the component- Returns:
- the scale of the graphical element
-
getSize
Return the component's size- Returns:
- size's dimensions
-
getLayout
Return the component's position (relative to its parent)- Returns:
- position's coordinates
-
getRotate
default double getRotate()Return the angle of the component- Returns:
- angle value of the component
-
setRotate
default void setRotate(double angle)Set the angle at which the component is rotated- Parameters:
angle- component's new rotation angle
-
getZOrder
default double getZOrder()The depth of the component- Returns:
- the depth of the sprite
-
setZOrder
default void setZOrder(double z)Update the order or depth of the component- Parameters:
z- is the new depth
-