Class BlockDrawable
- java.lang.Object
-
- com.badlogic.gdx.scenes.scene2d.utils.BaseDrawable
-
- com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable
-
- com.bombinggames.wurfelengine.mapeditor.BlockDrawable
-
public class BlockDrawable extends com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable
a class what renders a block using the drawable interface.
-
-
Constructor Summary
Constructors Constructor Description BlockDrawable(byte id)
BlockDrawable(byte id, byte value, float size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
draw(com.badlogic.gdx.graphics.g2d.Batch batch, float x, float y, float width, float height)
void
draw(com.badlogic.gdx.graphics.g2d.Batch batch, float x, float y, float originX, float originY, float width, float height, float scaleX, float scaleY, float rotation)
float
getBottomHeight()
float
getLeftWidth()
float
getMinWidth()
float
getOffstringX()
Get the value of offstringXfloat
getOffstringY()
Get the value of offstringYRenderCell
getRenderBlock()
float
getRightWidth()
float
getTopHeight()
protected byte
getValue()
void
setOffsetX(float offstringX)
Set the value of offstringXvoid
setOffsetY(float offstringY)
Set the value of offstringYprotected void
setValue(byte value)
Set game and sprite value of this block.-
Methods inherited from class com.badlogic.gdx.scenes.scene2d.utils.BaseDrawable
getMinHeight, getName, setBottomHeight, setLeftWidth, setMinHeight, setMinWidth, setName, setRightWidth, setTopHeight, toString
-
Methods inherited from interface com.badlogic.gdx.scenes.scene2d.utils.Drawable
getMinHeight, setBottomHeight, setLeftWidth, setMinHeight, setMinWidth, setRightWidth, setTopHeight
-
-
-
-
Method Detail
-
setValue
protected void setValue(byte value)
Set game and sprite value of this block.- Parameters:
value
-
-
getValue
protected byte getValue()
- Returns:
-
draw
public void draw(com.badlogic.gdx.graphics.g2d.Batch batch, float x, float y, float width, float height)
- Overrides:
draw
in classcom.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable
-
getOffstringX
public float getOffstringX()
Get the value of offstringX- Returns:
- the value of offstringX
-
setOffsetX
public void setOffsetX(float offstringX)
Set the value of offstringX- Parameters:
offstringX
- new value of offstringX
-
getOffstringY
public float getOffstringY()
Get the value of offstringY- Returns:
- the value of offstringY
-
setOffsetY
public void setOffsetY(float offstringY)
Set the value of offstringY- Parameters:
offstringY
- new value of offstringY
-
draw
public void draw(com.badlogic.gdx.graphics.g2d.Batch batch, float x, float y, float originX, float originY, float width, float height, float scaleX, float scaleY, float rotation)
- Overrides:
draw
in classcom.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable
- Parameters:
batch
-x
-y
-originX
-originY
-width
-height
-scaleX
-scaleY
-rotation
-
-
getLeftWidth
public float getLeftWidth()
- Overrides:
getLeftWidth
in classcom.badlogic.gdx.scenes.scene2d.utils.BaseDrawable
- Returns:
-
getRightWidth
public float getRightWidth()
- Overrides:
getRightWidth
in classcom.badlogic.gdx.scenes.scene2d.utils.BaseDrawable
- Returns:
-
getTopHeight
public float getTopHeight()
- Overrides:
getTopHeight
in classcom.badlogic.gdx.scenes.scene2d.utils.BaseDrawable
- Returns:
-
getBottomHeight
public float getBottomHeight()
- Overrides:
getBottomHeight
in classcom.badlogic.gdx.scenes.scene2d.utils.BaseDrawable
- Returns:
-
getMinWidth
public float getMinWidth()
- Overrides:
getMinWidth
in classcom.badlogic.gdx.scenes.scene2d.utils.BaseDrawable
- Returns:
-
getRenderBlock
public RenderCell getRenderBlock()
- Returns:
-
-