Class QuadActor

java.lang.Object
com.badlogic.gdx.scenes.scene2d.Actor
com.badlogic.gdx.scenes.scene2d.ui.Widget
com.prineside.tdi2.ui.actors.QuadActor
All Implemented Interfaces:
com.badlogic.gdx.scenes.scene2d.utils.Layout

public class QuadActor extends com.badlogic.gdx.scenes.scene2d.ui.Widget
  • Constructor Summary

    Constructors
    Constructor
    Description
    QuadActor(float[] vertices, int[] colors)
     
    QuadActor(float[] vertices, com.badlogic.gdx.graphics.Color color)
     
    QuadActor(float[] vertices, com.badlogic.gdx.graphics.Color bottomLeft, com.badlogic.gdx.graphics.Color topLeft, com.badlogic.gdx.graphics.Color topRight, com.badlogic.gdx.graphics.Color bottomRight)
     
    QuadActor(com.badlogic.gdx.graphics.Color[] colors, float[] positions)
     
    QuadActor(com.badlogic.gdx.graphics.Color color, float[] positions)
    Сразу задает размеры в пикселях.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    draw(com.badlogic.gdx.graphics.g2d.Batch batch, float parentAlpha)
    If this method is overridden, the super method or Widget.validate() should be called to ensure the widget is laid out.
    com.badlogic.gdx.graphics.g2d.TextureRegion
     
    float[]
     
    void
    setTextureRegion(com.badlogic.gdx.graphics.g2d.TextureRegion region)
     
    void
    setVertexColors(int[] colors)
     
    void
    setVertexColors(com.badlogic.gdx.graphics.Color color)
     
    void
    setVertexColors(com.badlogic.gdx.graphics.Color bottomLeft, com.badlogic.gdx.graphics.Color topLeft, com.badlogic.gdx.graphics.Color topRight, com.badlogic.gdx.graphics.Color bottomRight)
     
    void
    setVertexPositions(float[] positions)
     
    void
    setVertices(float[] vertices)
     

    Methods inherited from class com.badlogic.gdx.scenes.scene2d.ui.Widget

    getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getPrefHeight, getPrefWidth, invalidate, invalidateHierarchy, layout, needsLayout, pack, setFillParent, setLayoutEnabled, validate

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

    act, addAction, addCaptureListener, addListener, ancestorsVisible, ascendantsVisible, clear, clearActions, clearListeners, clipBegin, clipBegin, clipEnd, debug, drawDebug, 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, remove, removeAction, removeCaptureListener, removeListener, rotateBy, scaleBy, scaleBy, screenToLocalCoordinates, setBounds, setColor, setColor, setDebug, setHeight, setName, setOrigin, setOrigin, setOriginX, setOriginY, setPosition, setPosition, setRotation, setScale, setScale, setScaleX, setScaleY, setSize, setTouchable, setUserObject, setVisible, setWidth, setX, setX, setY, setY, setZIndex, sizeBy, sizeBy, stageToLocalCoordinates, toBack, toFront, toString

    Methods inherited from class java.lang.Object

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

    • QuadActor

      public QuadActor(float[] vertices, int[] colors)
      Parameters:
      vertices - массив из 8 чисел - позиций вершин четырехугольника. Значения от 0 до 1 { x, y, Bottom Left x, y, Top Left x, y, Top Right x, y Bottom right }
      colors - массив цветов 4 вершин четырехугольника. Значения от 0 до 255 { r, g, b, a, Bottom Left r, g, b, a, Top Left r, g, b, a, Top Right r, g, b, a Bottom right }
    • QuadActor

      public QuadActor(float[] vertices, com.badlogic.gdx.graphics.Color color)
    • QuadActor

      public QuadActor(com.badlogic.gdx.graphics.Color color, float[] positions)
      Сразу задает размеры в пикселях. Ширина и высота будет установлена автоматически
      Parameters:
      positions - массив из 8 чисел - позиций вершин четырехугольника. Значения в пикселях { x, y, Bottom Left x, y, Top Left x, y, Top Right x, y Bottom right }
    • QuadActor

      public QuadActor(com.badlogic.gdx.graphics.Color[] colors, float[] positions)
    • QuadActor

      public QuadActor(float[] vertices, com.badlogic.gdx.graphics.Color bottomLeft, com.badlogic.gdx.graphics.Color topLeft, com.badlogic.gdx.graphics.Color topRight, com.badlogic.gdx.graphics.Color bottomRight)
  • Method Details

    • setTextureRegion

      public void setTextureRegion(com.badlogic.gdx.graphics.g2d.TextureRegion region)
    • getTextureRegion

      public com.badlogic.gdx.graphics.g2d.TextureRegion getTextureRegion()
    • getVertexPositions

      public float[] getVertexPositions()
    • setVertexPositions

      public void setVertexPositions(float[] positions)
    • setVertices

      public void setVertices(float[] vertices)
    • setVertexColors

      public void setVertexColors(int[] colors)
    • setVertexColors

      public void setVertexColors(com.badlogic.gdx.graphics.Color bottomLeft, com.badlogic.gdx.graphics.Color topLeft, com.badlogic.gdx.graphics.Color topRight, com.badlogic.gdx.graphics.Color bottomRight)
    • setVertexColors

      public void setVertexColors(com.badlogic.gdx.graphics.Color color)
    • draw

      public void draw(com.badlogic.gdx.graphics.g2d.Batch batch, float parentAlpha)
      Description copied from class: com.badlogic.gdx.scenes.scene2d.ui.Widget
      If this method is overridden, the super method or Widget.validate() should be called to ensure the widget is laid out.
      Overrides:
      draw in class com.badlogic.gdx.scenes.scene2d.ui.Widget
      parentAlpha - The parent alpha, to be multiplied with this actor's alpha, allowing the parent's alpha to affect all children.