Class CanvasGroup
java.lang.Object
dev.prozilla.pine.core.component.Component
dev.prozilla.pine.core.component.canvas.CanvasGroup
- All Implemented Interfaces:
Lifecycle
,Printable
,CanvasContext
,ComponentFinder
,EntityFinder
A component that groups multiple canvas elements together and aligns them.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionboolean
Array of rect components in children of the attached entitystatic final EdgeAlignment
static final Direction
static final CanvasGroup.Distribution
int
Distance between elements. -
Constructor Summary
ConstructorsConstructorDescriptionCanvasGroup
(Direction direction) CanvasGroup
(Direction direction, EdgeAlignment alignment) CanvasGroup
(Direction direction, EdgeAlignment alignment, CanvasGroup.Distribution distribution) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Finds and stores rect components in children to be used in calculations later.int
getName()
getRect()
int
getWidth()
int
getX()
int
getY()
void
setPadding
(DualDimension padding) Methods inherited from class dev.prozilla.pine.core.component.Component
equals, getCamera, getChildWithTag, getComponent, getComponentInParent, getComponentInParent, getComponents, getComponentsInChildren, getEntity, getInput, getLogger, getParentWithTag, getRenderer, getTimer, getTracker, getTransform, getWindow, getWorld, hashCode, setActive, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Field Details
-
direction
-
alignment
-
distribution
-
backgroundColor
-
gap
public int gapDistance between elements. -
padding
-
arrangeChildren
public boolean arrangeChildren -
innerSize
-
totalChildrenSize
-
childRects
Array of rect components in children of the attached entity -
rect
-
DEFAULT_DIRECTION
-
DEFAULT_ALIGNMENT
-
DEFAULT_DISTRIBUTION
-
-
Constructor Details
-
CanvasGroup
public CanvasGroup() -
CanvasGroup
-
CanvasGroup
-
CanvasGroup
public CanvasGroup(Direction direction, EdgeAlignment alignment, CanvasGroup.Distribution distribution)
-
-
Method Details
-
getName
-
setPadding
-
getChildComponents
public void getChildComponents()Finds and stores rect components in children to be used in calculations later. -
getRect
-
getX
public int getX()- Specified by:
getX
in interfaceCanvasContext
-
getY
public int getY()- Specified by:
getY
in interfaceCanvasContext
-
getWidth
public int getWidth()- Specified by:
getWidth
in interfaceCanvasContext
-
getHeight
public int getHeight()- Specified by:
getHeight
in interfaceCanvasContext
-