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.BodybodyThe collision and interactionBodyzone of theItemprivate floatheightThe height of theItem, in in-game metresprivate com.badlogic.gdx.graphics.TexturetextureThe LibGDXDrawablegraphical representation of theSpriteprivate floatwidthThe width of theItem, in in-game metres
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()Releases all resources used by theItem(package private) com.badlogic.gdx.math.Vector2getPosition()Retrieves the position of theItemvoidrender(com.badlogic.gdx.graphics.g2d.SpriteBatch batch)Registers the currentItemonto the given game instanceSpriteBatch
-
-
-
Field Detail
-
texture
private final com.badlogic.gdx.graphics.Texture texture
The LibGDXDrawablegraphical 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 interactionBodyzone of theItem- See Also:
World
-
-
Method Detail
-
dispose
public void dispose()
Releases all resources used by theItem- Specified by:
disposein interfacecom.badlogic.gdx.utils.Disposable
-
render
public void render(com.badlogic.gdx.graphics.g2d.SpriteBatch batch)
Registers the currentItemonto the given game instanceSpriteBatch
-
getPosition
com.badlogic.gdx.math.Vector2 getPosition()
Retrieves the position of theItem- Returns:
- The position of the body
-
-