Class MapItemActor

java.lang.Object
com.badlogic.gdx.scenes.scene2d.Actor
com.esotericsoftware.spine.utils.SkeletonActor
fr.formiko.kokcinelo.view.MapItemActor

public class MapItemActor extends com.esotericsoftware.spine.utils.SkeletonActor
Actor that represent a MapItem.
Since:
0.1
Version:
1.3
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Stores information needed by the view for a character state.
  • Constructor Summary

    Constructors
    Constructor
    Description
    MapItemActor(MapItem mapItem, int width, int height)
    Secondary constructor with a null texture but a fix size.
    MapItemActor(String textureName, MapItem mapItem)
    Main constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    act(float delta)
    Update this actor.
    void
    animate(String animationName, int animationId)
    Animate the creature.
    void
    draw(com.badlogic.gdx.graphics.g2d.Batch batch, float parentAlpha)
    Draw this actor texture and if showZone draw all debug info.
    void
    drawDebugCircles(com.badlogic.gdx.graphics.g2d.Batch batch, float parentAlpha)
    Draw debug circles for visionRadius and hitRadius.
    void
    drawSkeleton(com.badlogic.gdx.graphics.g2d.Batch batch, float parentAlpha, com.badlogic.gdx.graphics.Color color)
    Draw skeleton.
    com.badlogic.gdx.math.Vector2
     
    float
     
    float
     
    float
     
    void
    moveFront(float distance)
    Move in the facing direction.
    boolean
    moveIn(float maxX, float maxY)
    move Creature location between the rectangle 0,0,maxX,maxY if needed.
    void
    setCenter(float x, float y)
    Set center location.
    void
    setCenterX(float x)
     
    void
    setCenterY(float y)
     
    void
    setRandomLoaction(float maxX, float maxY)
    Set center loaction to a random loaction
    void
    setZoom(float zoom)
     
    Standard toString that return important vars as String.
    void
    translate(float x, float y)
    Move in x & y

    Methods inherited from class com.esotericsoftware.spine.utils.SkeletonActor

    getAnimationState, getRenderer, getResetBlendFunction, getSkeleton, setAnimationState, setRenderer, setResetBlendFunction, setSkeleton

    Methods inherited from class com.badlogic.gdx.scenes.scene2d.Actor

    addAction, addCaptureListener, addListener, ancestorsVisible, ascendantsVisible, clear, clearActions, clearListeners, clipBegin, clipBegin, clipEnd, debug, drawDebug, drawDebugBounds, fire, firstAscendant, getActions, getCaptureListeners, getColor, getDebug, getHeight, getListeners, getName, getOriginX, getOriginY, getParent, getRight, getRotation, getScaleX, getScaleY, getStage, getTop, getTouchable, getUserObject, getWidth, getX, getX, getY, getY, getZIndex, hasActions, hasKeyboardFocus, hasParent, hasScrollFocus, hit, isAscendantOf, isDescendantOf, isTouchable, isTouchFocusListener, isTouchFocusTarget, isVisible, localToActorCoordinates, localToAscendantCoordinates, localToParentCoordinates, localToScreenCoordinates, localToStageCoordinates, moveBy, notify, parentToLocalCoordinates, positionChanged, remove, removeAction, removeCaptureListener, removeListener, rotateBy, rotationChanged, scaleBy, scaleBy, scaleChanged, screenToLocalCoordinates, setBounds, setColor, setColor, setDebug, setHeight, setName, setOrigin, setOrigin, setOriginX, setOriginY, setParent, setPosition, setPosition, setRotation, setScale, setScale, setScaleX, setScaleY, setSize, setStage, setTouchable, setUserObject, setVisible, setWidth, setX, setX, setY, setY, setZIndex, sizeBy, sizeBy, sizeChanged, stageToLocalCoordinates, toBack, toFront

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MapItemActor

      public MapItemActor(@Null String textureName, MapItem mapItem)
      Main constructor.
      Parameters:
      textureName - name of the texture to use to represent this Actor
      mapItem - MapItem represent by this
    • MapItemActor

      public MapItemActor(MapItem mapItem, int width, int height)
      Secondary constructor with a null texture but a fix size.
      Parameters:
      mapItem - MapItem represent by this
      width - width of the actor
      height - height of the actor
  • Method Details

    • draw

      public void draw(com.badlogic.gdx.graphics.g2d.Batch batch, float parentAlpha)
      Draw this actor texture and if showZone draw all debug info. Debug info are represent as circle for visionRadius & hitRadius.
      Overrides:
      draw in class com.esotericsoftware.spine.utils.SkeletonActor
      Parameters:
      batch - batch were to draw
      parentAlpha - alpha of the parent to draw at same alpha
    • drawDebugCircles

      public void drawDebugCircles(com.badlogic.gdx.graphics.g2d.Batch batch, float parentAlpha)
      Draw debug circles for visionRadius and hitRadius.
      Parameters:
      batch - batch were to draw
      parentAlpha - alpha of the parent to draw at same alpha
    • drawSkeleton

      public void drawSkeleton(com.badlogic.gdx.graphics.g2d.Batch batch, float parentAlpha, com.badlogic.gdx.graphics.Color color)
      Draw skeleton.
      Parameters:
      batch - batch were to draw
      parentAlpha - alpha of the parent to draw at same alpha
      color - color of the parent to draw at same color
    • act

      public void act(float delta)
      Update this actor. It update skeleton to the same rotation and scale than the actor.
      Overrides:
      act in class com.esotericsoftware.spine.utils.SkeletonActor
      Parameters:
      delta - time since last update
    • toString

      public String toString()
      Standard toString that return important vars as String.
      Overrides:
      toString in class com.badlogic.gdx.scenes.scene2d.Actor
    • setZoom

      public void setZoom(float zoom)
    • getZoom

      public float getZoom()
    • setRandomLoaction

      public void setRandomLoaction(float maxX, float maxY)
      Set center loaction to a random loaction
      Parameters:
      maxX - max value of x
      maxY - max value of y
    • getCenterX

      public float getCenterX()
    • getCenterY

      public float getCenterY()
    • getCenter

      public com.badlogic.gdx.math.Vector2 getCenter()
    • setCenterX

      public void setCenterX(float x)
    • setCenterY

      public void setCenterY(float y)
    • setCenter

      public void setCenter(float x, float y)
      Set center location.
    • translate

      public void translate(float x, float y)
      Move in x & y
      Parameters:
      x - x
      y - y
    • moveFront

      public void moveFront(float distance)
      Move in the facing direction.
      Parameters:
      distance - distance to move
    • moveIn

      public boolean moveIn(float maxX, float maxY)
      move Creature location between the rectangle 0,0,maxX,maxY if needed.
      Parameters:
      maxX - the max x for the creature
      maxY - the max y for the creature
      Returns:
      true if Creature have been move
    • animate

      public void animate(String animationName, int animationId)
      Animate the creature.
      Parameters:
      animationName - Name of the animation
      animationId - Id of the animation. It can be the same as an other animation that need to stop before starting this one.