Class AxisLayoutOptions

#include <Geode/cocos/base_nodes/Layout.hpp>
classAxisLayoutOptions:publiccocos2d::LayoutOptions{ ... }

Options for controlling the behaviour of individual nodes in an AxisLayout

Examples1
auto node = CCNode::create();
// this node will have 10 units of spacing between it and the next one
node->setLayoutOptions(
    AxisLayoutOptions::create()
        ->setNextGap(10.f)
);
someNodeWithALayout->addChild(node);
Public static methods1
staticcocos2d::AxisLayoutOptions*create()
No description provided
Public member functions25
std::optional<bool>getAutoScale()const
No description provided
floatgetMaxScale()const
No description provided
floatgetMinScale()const
No description provided
boolhasExplicitMaxScale()const
No description provided
boolhasExplicitMinScale()const
No description provided
floatgetRelativeScale()const
No description provided
std::optional<float>getLength()const
No description provided
std::optional<float>getPrevGap()const
No description provided
std::optional<float>getNextGap()const
No description provided
boolgetBreakLine()const
No description provided
boolgetSameLine()const
No description provided
intgetScalePriority()const
No description provided
std::optional<cocos2d::AxisAlignment>getCrossAxisAlignment()const
No description provided
cocos2d::AxisLayoutOptions*setMaxScale(
floatscale
)

Set the maximum scale this node can be if it’s contained in an auto-scaled layout. Default is 1

cocos2d::AxisLayoutOptions*setMinScale(
floatscale
)

Set the minimum scale this node can be if it’s contained in an auto-scaled layout. Default is AXISLAYOUT_DEFAULT_MIN_SCALE

cocos2d::AxisLayoutOptions*setScaleLimits(,)

Set the limits to what the node can be scaled to. Passing std::nullopt uses the parent layout’s default min / max scales

cocos2d::AxisLayoutOptions*setRelativeScale(
floatscale
)

Set the relative scale of this node compared to other nodes if it’s contained in an auto-scaled layout. Default is 1

cocos2d::AxisLayoutOptions*setAutoScale()

Set auto-scaling for this node, overriding the layout’s auto-scale setting. If nullopt, the layout’s auto-scale options will be used

cocos2d::AxisLayoutOptions*setLength()

Set an absolute length for this node. If nullopt, the length will be dynamically calculated based on content size

cocos2d::AxisLayoutOptions*setPrevGap()

Override the default gap in the layout between this node and the previous one. If nullopt, the default gap of the layout will be used

cocos2d::AxisLayoutOptions*setNextGap()

Override the default gap in the layout between this node and the next one. If nullopt, the default gap of the layout will be used

cocos2d::AxisLayoutOptions*setBreakLine(
boolenable
)

If enabled, the node will always cause a growable axis layout to break into a new line even if the current line could’ve fit the next node

cocos2d::AxisLayoutOptions*setSameLine(
boolenable
)

If enabled, the node will be forced to be on the same line as the previous node even if doing this would overflow

cocos2d::AxisLayoutOptions*setScalePriority(
intpriority
)

Set the scale priority of this node. Nodes with higher priority will be scaled down first before nodes with lower priority when an auto-scaled layout attempts to fit its contents. Default is AXISLAYOUT_DEFAULT_PRIORITY

ℹ For optimal performance, the priorities should all be close to each other with no gaps

cocos2d::AxisLayoutOptions*setCrossAxisAlignment()

Override the cross axis alignment for this node in the layout

Fields0
Protected member functions0
Protected fields1
;
No description provided