Skip to content

Commit

Permalink
Steps of layout method
Browse files Browse the repository at this point in the history
  • Loading branch information
rexrainbow committed Nov 21, 2023
1 parent f9d236c commit ff41fa5
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions templates/ui/basesizer/layout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Layout

Resize and place children.

## Steps

1. Set scaleX, scaleY to `1` of this game object
1. Store current scaleX, scaleY
1. Set scaleX, scaleY to `1`
1. Layout this game object
1. Skip layout if this game object is
- Hidden
- Not dirty
1. From isTopmostParent, Prelayout :
- Clear `_childrenWidth`, `_childrenHeight` properties of all children.
- Custom logic of Prelayout
1. Calculate width of this game object
- Max value of total children width, or `minWidth` of this game object
1. From isTopmostParent, calculate width of all children
1. From isTopmostParent, run width-wrap of this game object and all children
1. Calculate height of this game object
1. Custom logic of change size of children
1. Resize this game object according to step 2.3 and step 2.6
1. Layout children, start from step 2
- Custom logic of `layoutChildren`
1. Layout background
1. Default PostLayout :
- Anchor position
1. Custom logic of PostLayout
1. Restore scaleX, scaleY of this game object

0 comments on commit ff41fa5

Please sign in to comment.