This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
extensions:alignable-objects [2011/06/12 12:31] – [Usage] jugibur | extensions:alignable-objects [2015/09/14 11:15] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ~~NOTOC~~ | ||
+ | ====== Alignable-objects ====== | ||
+ | |||
+ | ---- dataentry extension ---- | ||
+ | type : extension | ||
+ | author_mail | ||
+ | description | ||
+ | lastupdate_dt : 2011-07-15 | ||
+ | compatible | ||
+ | depends | ||
+ | tags : alignable, arranging, aligning | ||
+ | homepage_url | ||
+ | download_url | ||
+ | ---- | ||
+ | |||
+ | ===== Usage ===== | ||
+ | |||
+ | {{http:// | ||
+ | |||
+ | To get the same result as seen in the screenshot, just replace the code in the " | ||
+ | |||
+ | <code objc> | ||
+ | // Make a light gray background | ||
+ | | ||
+ | |||
+ | // Create a red large box ... | ||
+ | | ||
+ | [self addChild: | ||
+ | | ||
+ | | ||
+ | // ... and add it to the background | ||
+ | [self addChild: | ||
+ | | ||
+ | // Align this red box to ... | ||
+ | | ||
+ | | ||
+ | |||
+ | // Create a group sprite and add 3 yellow child boxes | ||
+ | | ||
+ | | ||
+ | |||
+ | // Box 1 | ||
+ | | ||
+ | | ||
+ | | ||
+ | // Box 2 | ||
+ | | ||
+ | | ||
+ | // Box 3 | ||
+ | | ||
+ | | ||
+ | |||
+ | // Align all child boxes vertical from top to bottom with a gap of 10px | ||
+ | | ||
+ | // The above line is a shortcut for this: | ||
+ | // [childBoxesGroup vArrangeChildrenWithGap: | ||
+ | // [childBoxesGroup vAlign:0 offsetPx: | ||
+ | |||
+ | | ||
+ | </ | ||
+ | |||
+ | Make sure to import " | ||
+ | |||
+ | These are the original PNGs: | ||
+ | {{http:// | ||
+ | {{http:// | ||
+ | ===== Changelog ===== | ||
+ | |||
+ | * // | ||
+ | * // | ||
+ | ===== Source Code ===== | ||
+ | |||
+ | %gist(224ef2d4ae597df2e94d)% | ||
+ | |||
+ | ===== Discussion ===== | ||
+ | |||
+ | //No comments so far. Feel free to edit this part of the page.// |