Package com.misc

Class Arrow

  • All Implemented Interfaces:
    com.badlogic.gdx.math.Shape2D

    public class Arrow
    extends com.badlogic.gdx.math.Polygon
    Creates a polygon which looks like an arrow which points to a target vector
    • Constructor Summary

      Constructors 
      Constructor Description
      Arrow​(float baseWidth, float headWidth, float baseHeight, float headHeight)
      Constructs an arrow with the following parameters
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void aimAtTarget​(com.badlogic.gdx.math.Vector2 target)
      "Update" function which rotates the arrow head to point to the the target
      • Methods inherited from class com.badlogic.gdx.math.Polygon

        area, contains, contains, dirty, getBoundingRectangle, getOriginX, getOriginY, getRotation, getScaleX, getScaleY, getTransformedVertices, getVertices, getX, getY, rotate, scale, setOrigin, setPosition, setRotation, setScale, setVertices, translate
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Arrow

        public Arrow​(float baseWidth,
                     float headWidth,
                     float baseHeight,
                     float headHeight)
        Constructs an arrow with the following parameters
        Parameters:
        baseWidth - width of the stem of the arrow
        headWidth - width of the pointy arrow head
        baseHeight - height of the stem of the arrow
        headHeight - height of the pointy arrow head
    • Method Detail

      • aimAtTarget

        public void aimAtTarget​(com.badlogic.gdx.math.Vector2 target)
        "Update" function which rotates the arrow head to point to the the target
        Parameters:
        target - vector of target