Class HUDElement
java.lang.Object
fr.r1r0r0.deltaengine.model.elements.HUDElement
- All Implemented Interfaces:
Element<java.lang.Double>
public class HUDElement extends java.lang.Object implements Element<java.lang.Double>
A graphical element for user. Can be used for HP bar or score text for example.
HUDElement is completely detached from current level or anything else
-
Field Summary
Fields Modifier and Type Field Description private Coordinates<java.lang.Double>
coordinates
private Dimension
dimension
private java.lang.String
name
private Sprite
sprite
-
Constructor Summary
Constructors Constructor Description HUDElement(java.lang.String name, Coordinates<java.lang.Double> coordinates, Sprite sprite, Dimension dimension)
Default constructor. -
Method Summary
Modifier and Type Method Description Coordinates<java.lang.Double>
getCoordinates()
Coordinates of the element in the game.Dimension
getDimension()
Return dimension of the Element.java.lang.String
getName()
Name getter of the elementSprite
getSprite()
Returns sprite of the elementvoid
setCoordinates(Coordinates<java.lang.Double> coordinates)
Allows setting new coordinates for the element.void
setDimension(Dimension dimension)
Allows to set dimension of the element, representing its size.void
setSprite(Sprite sprite)
Set sprite of an elementMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
sprite
-
coordinates
-
name
private java.lang.String name -
dimension
-
-
Constructor Details
-
HUDElement
public HUDElement(java.lang.String name, Coordinates<java.lang.Double> coordinates, Sprite sprite, Dimension dimension)Default constructor.- Parameters:
name
- String representing the name of the Elementcoordinates
- Coordinates of the elementsprite
- Sprite of the elementdimension
- Dimension of the element
-
-
Method Details
-
getDimension
Description copied from interface:Element
Return dimension of the Element. Represents the size of the Element.- Specified by:
getDimension
in interfaceElement<java.lang.Double>
- Returns:
- Dimension of the element
-
setDimension
Description copied from interface:Element
Allows to set dimension of the element, representing its size.- Specified by:
setDimension
in interfaceElement<java.lang.Double>
- Parameters:
dimension
- Dimension to set
-
getSprite
Description copied from interface:Element
Returns sprite of the element -
setSprite
Description copied from interface:Element
Set sprite of an element -
getCoordinates
Description copied from interface:Element
Coordinates of the element in the game.- Specified by:
getCoordinates
in interfaceElement<java.lang.Double>
- Returns:
- Coordinates of the element
-
setCoordinates
Description copied from interface:Element
Allows setting new coordinates for the element.- Specified by:
setCoordinates
in interfaceElement<java.lang.Double>
- Parameters:
coordinates
- new coordinates
-
getName
public java.lang.String getName()Description copied from interface:Element
Name getter of the element
-