Class CreateFlexComponents
Quick methods for creating new FlexItems and FlexContainers directly from script, with automatic Undo support, correct automatic setup/config, etc.
Namespace: NinjaTools.FlexBuilder
Assembly: cs.temp.dll.dll
Syntax
public static class CreateFlexComponents
Methods
- (FlexContainer) AddChildFlexContainerAndFlexItem(FlexContainer, String, out FlexItem, UndoBlock, Boolean)
Add a new FlexContainer to an existing FlexContainer, also auto-adding the required FlexItem to the new child, all at once
Parameters
FlexContainer | fc | The parent FlexContainer to add to |
String | title | What name to give the GameObject that is auto-created |
FlexItem | newFlexItem | The autocreated FlexItem on the new FlexContainer |
UndoBlock | undoBlock | |
Boolean | forceDebugMode |
Returns
FlexContainer | A new FlexContainer already added to the parent FlexContainer |
- (FlexItem) AddChildFlexItem(FlexContainer, String, UndoBlock)
Add a child FlexItem to a FlexContainer, creating the necessary GameObject etc all at once
Parameters
FlexContainer | fc | The parent FlexContainer to add to |
String | title | What name to give the GameObject that is auto-created |
UndoBlock | undoBlock |
Returns
FlexItem | A new FlexItem already added to the parent FlexContainer |
- (RootFlexContainer)
AddComponentRootFlexContainer(GameObject, IFlexboxLayoutAlgorithm, ITreeUpdateAlgorithm, IGizmoRenderer, IGizmoRenderer, UndoBlock)
Preferred way to convert an existing GameObject into a RootFlexContainer from script
Parameters
GameObject | go | |
IFlexboxLayoutAlgorithm | initialAlgorithm | |
ITreeUpdateAlgorithm | initialTreeAlgorithm | |
IGizmoRenderer<FlexContainer> | initialGizmoRendererFContainers | |
IGizmoRenderer<FlexItem> | initialGizmoRendererFItems | |
UndoBlock | undoBlock |
Returns
RootFlexContainer |
- (RootFlexContainer)
AddFlexRootContainer(RectTransform, IFlexboxLayoutAlgorithm, ITreeUpdateAlgorithm, IGizmoRenderer, IGizmoRenderer, Canvas, UndoBlock)
Preferred way to create new RootFlexContainer objects from script
Parameters
RectTransform | rt | |
IFlexboxLayoutAlgorithm | initialAlgorithm | |
ITreeUpdateAlgorithm | initialTreeAlgorithm | |
IGizmoRenderer<FlexContainer> | initialGizmoRendererFContainers | |
IGizmoRenderer<FlexItem> | initialGizmoRendererFItems | |
Canvas | rootCanvas | |
UndoBlock | undoBlock |
Returns
RootFlexContainer |
- (RootFlexContainer) ConvertToFlexRootContainer(FlexContainer, IFlexboxLayoutAlgorithm, ITreeUpdateAlgorithm, RootContainerSizeMode)
Upgrade an existing FlexContainer to a RootFlexContainer
Parameters
FlexContainer | original | |
IFlexboxLayoutAlgorithm | initialAlgorithm | |
ITreeUpdateAlgorithm | initialTreeAlgorithm | |
RootContainerSizeMode | initialSizeMode |
Returns
RootFlexContainer |
- (RootFlexContainer)
CreateFlexRootContainerWithCanvasEtc(IFlexboxLayoutAlgorithm, ITreeUpdateAlgorithm, IGizmoRenderer, IGizmoRenderer, UndoBlock)
Convenience method that auto-creates a Canvas in your project if none exists, then creates a new RootFlexContainer and adds it
Parameters
IFlexboxLayoutAlgorithm | initialAlgorithm | |
ITreeUpdateAlgorithm | initialTreeAlgorithm | |
IGizmoRenderer<FlexContainer> | initialGizmoRendererFContainers | |
IGizmoRenderer<FlexItem> | initialGizmoRendererFItems | |
UndoBlock | undoBlock |
Returns
RootFlexContainer |