Class 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 offstringX
      float getOffstringY​()
      Get the value of offstringY
      RenderCell getRenderBlock​()  
      float getRightWidth​()  
      float getTopHeight​()  
      protected byte getValue​()  
      void setOffsetX​(float offstringX)
      Set the value of offstringX
      void setOffsetY​(float offstringY)
      Set the value of offstringY
      protected 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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from class com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable

        getRegion, setRegion, tint
    • Constructor Detail

      • BlockDrawable

        public BlockDrawable​(byte id)
        Parameters:
        id -
      • BlockDrawable

        public BlockDrawable​(byte id,
                             byte value,
                             float size)
        Parameters:
        id - block id
        value - block value
        size - relative size
    • 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 class com.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 class com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable
        Parameters:
        batch -
        x -
        y -
        originX -
        originY -
        width -
        height -
        scaleX -
        scaleY -
        rotation -
      • getLeftWidth

        public float getLeftWidth​()
        Overrides:
        getLeftWidth in class com.badlogic.gdx.scenes.scene2d.utils.BaseDrawable
        Returns:
      • getRightWidth

        public float getRightWidth​()
        Overrides:
        getRightWidth in class com.badlogic.gdx.scenes.scene2d.utils.BaseDrawable
        Returns:
      • getTopHeight

        public float getTopHeight​()
        Overrides:
        getTopHeight in class com.badlogic.gdx.scenes.scene2d.utils.BaseDrawable
        Returns:
      • getBottomHeight

        public float getBottomHeight​()
        Overrides:
        getBottomHeight in class com.badlogic.gdx.scenes.scene2d.utils.BaseDrawable
        Returns:
      • getMinWidth

        public float getMinWidth​()
        Overrides:
        getMinWidth in class com.badlogic.gdx.scenes.scene2d.utils.BaseDrawable
        Returns:
      • getRenderBlock

        public RenderCell getRenderBlock​()
        Returns: