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 classCircularGroup.DragManagermanages dragging and velocity of its enclosing CircularGroup instancestatic interfaceCircularGroup.Modifier -
Constructor Summary
Constructors Constructor Description CircularGroup()CircularGroup(boolean draggable)CircularGroup(CircularGroup.Modifier modifier)CircularGroup(CircularGroup.Modifier modifier, boolean draggable) -
Method Summary
Modifier and Type Method Description voidact(float delta)protected voidcomputeSize()computescachedMinWidth,cachedMinHeight,cachedPrefWidthandcachedPrefHeightvoiddrawDebug(com.badlogic.gdx.graphics.glutils.ShapeRenderer shapes)floatgetAngleOffset()CircularGroup.DragManagergetDragManager()floatgetFullAngle()floatgetMaxAngleOffset()floatgetMinAngleOffset()floatgetMinHeight()does not take rotation into accountfloatgetMinWidth()does not take rotation into accountCircularGroup.ModifiergetModifier()floatgetPrefHeight()floatgetPrefWidth()voidinvalidate()booleanisDraggable()booleanisShrinkChildren()booleanisVirtualChildEnabled()voidlayout()voidsetAngleOffset(float angleOffset)voidsetDraggable(boolean draggable)voidsetFullAngle(float fullAngle)setFullAngle(float, boolean)with automatic estimation if avirtualChildEnabledwould make sense.voidsetFullAngle(float fullAngle, boolean virtualChildEnabled)voidsetMaxAngleOffset(float maxAngleOffset)clampsangleOffsetto the new boundsvoidsetMinAngleOffset(float minAngleOffset)clampsangleOffsetto the new boundsvoidsetModifier(CircularGroup.Modifier modifier)voidsetShrinkChildren(boolean shrinkChildren)voidsetVirtualChildEnabled(boolean virtualChildEnabled)voidtranslateAngleOffsetLimits(float amount)Methods inherited from class com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup
childrenChanged, draw, getMaxHeight, getMaxWidth, invalidateHierarchy, needsLayout, pack, setFillParent, setLayoutEnabled, sizeChanged, validateMethods inherited from class com.badlogic.gdx.scenes.scene2d.Group
addActor, addActorAfter, addActorAt, addActorBefore, applyTransform, applyTransform, clear, clearChildren, computeTransform, debugAll, drawChildren, drawDebugChildren, findActor, getChild, getChildren, getCullingArea, hasChildren, hit, isTransform, localToDescendantCoordinates, removeActor, removeActor, removeActorAt, resetTransform, resetTransform, setCullingArea, setDebug, setStage, setTransform, swapActor, swapActor, toStringMethods 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, toFrontMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
CircularGroup
public CircularGroup()- See Also:
CircularGroup(Modifier)
-
CircularGroup
- Parameters:
modifier- themodifierto set
-
CircularGroup
public CircularGroup(boolean draggable)- See Also:
CircularGroup(Modifier, boolean)
-
CircularGroup
- Parameters:
draggable- seesetDraggable(boolean)- See Also:
CircularGroup(Modifier)
-
-
Method Details
-
act
public void act(float delta)- Overrides:
actin classcom.badlogic.gdx.scenes.scene2d.Group
-
drawDebug
public void drawDebug(com.badlogic.gdx.graphics.glutils.ShapeRenderer shapes)- Overrides:
drawDebugin classcom.badlogic.gdx.scenes.scene2d.Group
-
computeSize
protected void computeSize()computescachedMinWidth,cachedMinHeight,cachedPrefWidthandcachedPrefHeight -
getMinWidth
public float getMinWidth()does not take rotation into account- Specified by:
getMinWidthin interfacecom.badlogic.gdx.scenes.scene2d.utils.Layout- Overrides:
getMinWidthin classcom.badlogic.gdx.scenes.scene2d.ui.WidgetGroup
-
getMinHeight
public float getMinHeight()does not take rotation into account- Specified by:
getMinHeightin interfacecom.badlogic.gdx.scenes.scene2d.utils.Layout- Overrides:
getMinHeightin classcom.badlogic.gdx.scenes.scene2d.ui.WidgetGroup
-
getPrefWidth
public float getPrefWidth()- Specified by:
getPrefWidthin interfacecom.badlogic.gdx.scenes.scene2d.utils.Layout- Overrides:
getPrefWidthin classcom.badlogic.gdx.scenes.scene2d.ui.WidgetGroup
-
getPrefHeight
public float getPrefHeight()- Specified by:
getPrefHeightin interfacecom.badlogic.gdx.scenes.scene2d.utils.Layout- Overrides:
getPrefHeightin classcom.badlogic.gdx.scenes.scene2d.ui.WidgetGroup
-
invalidate
public void invalidate()- Specified by:
invalidatein interfacecom.badlogic.gdx.scenes.scene2d.utils.Layout- Overrides:
invalidatein classcom.badlogic.gdx.scenes.scene2d.ui.WidgetGroup
-
layout
public void layout()- Specified by:
layoutin interfacecom.badlogic.gdx.scenes.scene2d.utils.Layout- Overrides:
layoutin classcom.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 translateminAngleOffsetandmaxAngleOffset
-
getFullAngle
public float getFullAngle()- Returns:
- the
fullAngle
-
setFullAngle
public void setFullAngle(float fullAngle)setFullAngle(float, boolean)with automatic estimation if avirtualChildEnabledwould make sense.- Parameters:
fullAngle- thefullAngleto set- See Also:
setFullAngle(float, boolean)
-
setFullAngle
public void setFullAngle(float fullAngle, boolean virtualChildEnabled)- Parameters:
fullAngle- thefullAngleto setvirtualChildEnabled- thevirtualChildEnabledto set
-
getAngleOffset
public float getAngleOffset()- Returns:
- the
angleOffset
-
setAngleOffset
public void setAngleOffset(float angleOffset)- Parameters:
angleOffset- TheangleOffsetto set. Will be clamped tominAngleOffsetandmaxAngleOffset.
-
getMinAngleOffset
public float getMinAngleOffset()- Returns:
- the
minAngleOffset
-
setMinAngleOffset
public void setMinAngleOffset(float minAngleOffset)clampsangleOffsetto the new bounds- Parameters:
minAngleOffset- theminAngleOffsetto set
-
getMaxAngleOffset
public float getMaxAngleOffset()- Returns:
- the
maxAngleOffset
-
setMaxAngleOffset
public void setMaxAngleOffset(float maxAngleOffset)clampsangleOffsetto the new bounds- Parameters:
maxAngleOffset- themaxAngleOffsetto set
-
isVirtualChildEnabled
public boolean isVirtualChildEnabled()- Returns:
- the
virtualChildEnabled
-
setVirtualChildEnabled
public void setVirtualChildEnabled(boolean virtualChildEnabled)- Parameters:
virtualChildEnabled- thevirtualChildEnabledto set
-
getModifier
- Returns:
- the
modifier
-
setModifier
- Parameters:
modifier- themodifierto set
-
isShrinkChildren
public boolean isShrinkChildren()- Returns:
- the
shrinkChildren
-
setShrinkChildren
public void setShrinkChildren(boolean shrinkChildren)- Parameters:
shrinkChildren- theshrinkChildrento set
-
getDragManager
- Returns:
- the
dragManager
-