Class CircularGroup

java.lang.Object
com.badlogic.gdx.scenes.scene2d.Actor
com.badlogic.gdx.scenes.scene2d.Group
com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup
net.dermetfan.gdx.scenes.scene2d.ui.CircularGroup
All Implemented Interfaces:
com.badlogic.gdx.scenes.scene2d.utils.Cullable, com.badlogic.gdx.scenes.scene2d.utils.Layout

public class CircularGroup extends com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup
a group that aligns its children in a circle
Since:
0.5.0
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    class 
    manages dragging and velocity of its enclosing CircularGroup instance
    static interface 
     
  • Field Summary

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

    POOLS
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    CircularGroup(boolean draggable)
     
     
    CircularGroup(CircularGroup.Modifier modifier, boolean draggable)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    act(float delta)
     
    protected void
    computes cachedMinWidth, cachedMinHeight, cachedPrefWidth and cachedPrefHeight
    void
    drawDebug(com.badlogic.gdx.graphics.glutils.ShapeRenderer shapes)
     
    float
     
     
    float
     
    float
     
    float
     
    float
    does not take rotation into account
    float
    does not take rotation into account
     
    float
     
    float
     
    void
     
    boolean
     
    boolean
     
    boolean
     
    void
     
    void
    setAngleOffset(float angleOffset)
     
    void
    setDraggable(boolean draggable)
     
    void
    setFullAngle(float fullAngle)
    setFullAngle(float, boolean) with automatic estimation if a virtualChildEnabled would make sense.
    void
    setFullAngle(float fullAngle, boolean virtualChildEnabled)
     
    void
    setMaxAngleOffset(float maxAngleOffset)
    clamps angleOffset to the new bounds
    void
    setMinAngleOffset(float minAngleOffset)
    clamps angleOffset to the new bounds
    void
     
    void
    setShrinkChildren(boolean shrinkChildren)
     
    void
    setVirtualChildEnabled(boolean virtualChildEnabled)
     
    void
     

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

    childrenChanged, draw, getMaxHeight, getMaxWidth, hit, invalidateHierarchy, needsLayout, pack, setFillParent, setLayoutEnabled, sizeChanged, validate

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

    addActor, addActorAfter, addActorAt, addActorBefore, applyTransform, applyTransform, clear, clear, clearChildren, clearChildren, computeTransform, debugAll, drawChildren, drawDebugChildren, findActor, getChild, getChildren, getCullingArea, hasChildren, isTransform, localToDescendantCoordinates, removeActor, removeActor, removeActorAt, resetTransform, resetTransform, setCullingArea, setDebug, setStage, setTransform, swapActor, swapActor, toString

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

    addAction, addCaptureListener, addListener, ancestorsVisible, ascendantsVisible, clearActions, clearListeners, clipBegin, clipBegin, clipEnd, debug, 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, 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, setTouchable, setUserObject, setVisible, setWidth, setX, setX, setY, setY, setZIndex, sizeBy, sizeBy, stageToLocalCoordinates, toBack, toFront

    Methods inherited from class java.lang.Object

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

  • Method Details

    • act

      public void act(float delta)
      Overrides:
      act in class com.badlogic.gdx.scenes.scene2d.Group
    • drawDebug

      public void drawDebug(com.badlogic.gdx.graphics.glutils.ShapeRenderer shapes)
      Overrides:
      drawDebug in class com.badlogic.gdx.scenes.scene2d.Group
    • computeSize

      protected void computeSize()
      computes cachedMinWidth, cachedMinHeight, cachedPrefWidth and cachedPrefHeight
    • getMinWidth

      public float getMinWidth()
      does not take rotation into account
      Specified by:
      getMinWidth in interface com.badlogic.gdx.scenes.scene2d.utils.Layout
      Overrides:
      getMinWidth in class com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup
    • getMinHeight

      public float getMinHeight()
      does not take rotation into account
      Specified by:
      getMinHeight in interface com.badlogic.gdx.scenes.scene2d.utils.Layout
      Overrides:
      getMinHeight in class com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup
    • getPrefWidth

      public float getPrefWidth()
      Specified by:
      getPrefWidth in interface com.badlogic.gdx.scenes.scene2d.utils.Layout
      Overrides:
      getPrefWidth in class com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup
    • getPrefHeight

      public float getPrefHeight()
      Specified by:
      getPrefHeight in interface com.badlogic.gdx.scenes.scene2d.utils.Layout
      Overrides:
      getPrefHeight in class com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup
    • invalidate

      public void invalidate()
      Specified by:
      invalidate in interface com.badlogic.gdx.scenes.scene2d.utils.Layout
      Overrides:
      invalidate in class com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup
    • layout

      public void layout()
      Specified by:
      layout in interface com.badlogic.gdx.scenes.scene2d.utils.Layout
      Overrides:
      layout in class com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup
    • isDraggable

      public boolean isDraggable()
      Returns:
      if this group is rotatable by dragging with the pointer
    • setDraggable

      public void setDraggable(boolean draggable)
      Parameters:
      draggable - if this group should be rotatable by dragging with the pointer
    • translateAngleOffsetLimits

      public void translateAngleOffsetLimits(float amount)
      Parameters:
      amount - the amount by which to translate minAngleOffset and maxAngleOffset
    • getFullAngle

      public float getFullAngle()
      Returns:
      the fullAngle
    • setFullAngle

      public void setFullAngle(float fullAngle)
      setFullAngle(float, boolean) with automatic estimation if a virtualChildEnabled would make sense.
      Parameters:
      fullAngle - the fullAngle to set
      See Also:
    • setFullAngle

      public void setFullAngle(float fullAngle, boolean virtualChildEnabled)
      Parameters:
      fullAngle - the fullAngle to set
      virtualChildEnabled - the virtualChildEnabled to set
    • getAngleOffset

      public float getAngleOffset()
      Returns:
      the angleOffset
    • setAngleOffset

      public void setAngleOffset(float angleOffset)
      Parameters:
      angleOffset - The angleOffset to set. Will be clamped to minAngleOffset and maxAngleOffset.
    • getMinAngleOffset

      public float getMinAngleOffset()
      Returns:
      the minAngleOffset
    • setMinAngleOffset

      public void setMinAngleOffset(float minAngleOffset)
      clamps angleOffset to the new bounds
      Parameters:
      minAngleOffset - the minAngleOffset to set
    • getMaxAngleOffset

      public float getMaxAngleOffset()
      Returns:
      the maxAngleOffset
    • setMaxAngleOffset

      public void setMaxAngleOffset(float maxAngleOffset)
      clamps angleOffset to the new bounds
      Parameters:
      maxAngleOffset - the maxAngleOffset to set
    • isVirtualChildEnabled

      public boolean isVirtualChildEnabled()
      Returns:
      the virtualChildEnabled
    • setVirtualChildEnabled

      public void setVirtualChildEnabled(boolean virtualChildEnabled)
      Parameters:
      virtualChildEnabled - the virtualChildEnabled to set
    • getModifier

      public CircularGroup.Modifier getModifier()
      Returns:
      the modifier
    • setModifier

      public void setModifier(CircularGroup.Modifier modifier)
      Parameters:
      modifier - the modifier to set
    • isShrinkChildren

      public boolean isShrinkChildren()
      Returns:
      the shrinkChildren
    • setShrinkChildren

      public void setShrinkChildren(boolean shrinkChildren)
      Parameters:
      shrinkChildren - the shrinkChildren to set
    • getDragManager

      public CircularGroup.DragManager getDragManager()
      Returns:
      the dragManager