Class Item
- java.lang.Object
-
- bytemusketeers.heslingtonhustle.scene.Item
-
- All Implemented Interfaces:
Drawable
,com.badlogic.gdx.utils.Disposable
- Direct Known Subclasses:
Interactable
class Item extends java.lang.Object implements Drawable
- Author:
- ENG1 Team 23 (Cohort 3)
-
-
Field Summary
Fields Modifier and Type Field Description private com.badlogic.gdx.physics.box2d.Body
body
The collision and interactionBody
zone of theItem
private float
height
The height of theItem
, in in-game metresprivate com.badlogic.gdx.graphics.Texture
texture
The LibGDXDrawable
graphical representation of theSprite
private float
width
The width of theItem
, in in-game metres
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
Releases all resources used by theItem
(package private) com.badlogic.gdx.math.Vector2
getPosition()
Retrieves the position of theItem
void
render(com.badlogic.gdx.graphics.g2d.SpriteBatch batch)
Registers the currentItem
onto the given game instanceSpriteBatch
-
-
-
Field Detail
-
texture
private final com.badlogic.gdx.graphics.Texture texture
The LibGDXDrawable
graphical representation of theSprite
-
width
private final float width
The width of theItem
, in in-game metres
-
height
private final float height
The height of theItem
, in in-game metres
-
body
private final com.badlogic.gdx.physics.box2d.Body body
The collision and interactionBody
zone of theItem
- See Also:
World
-
-
Method Detail
-
dispose
public void dispose()
Releases all resources used by theItem
- Specified by:
dispose
in interfacecom.badlogic.gdx.utils.Disposable
-
render
public void render(com.badlogic.gdx.graphics.g2d.SpriteBatch batch)
Registers the currentItem
onto the given game instanceSpriteBatch
-
getPosition
com.badlogic.gdx.math.Vector2 getPosition()
Retrieves the position of theItem
- Returns:
- The position of the body
-
-