Been posting this on Google+, putting it all together here for my easy reference : )
Rough plan of the ‘9box’ symbol. It should allow guides if needed, but autodetect your intentions if it can do that correctly. Potentially even autodetect the 9box (or nBox) from a bitmap. A true 3box (where the tl and bl are not symmetrical) would need to be specified in the properties.
It also needs layers for things that cover the whole box, like a shadow or highlight. These things can scale based on their locks and springs – so eg a highlight on the entire box, or textbox with it’s top left corner locked to the top left box’s center point.
- templates are per device or per screen (template is created for each target screen, all common devices have prebuilt templates).
- some devices (like XBoxes) have an unknown screen, so you can target multiple screen (eg: put unimportant graphics in the 16:9 area).
- guides are attached to the template, not the rulers.
- guides are locked to the template, and move/grow proportionally as the template changes.
- There is a view mode for each targeted template. Automated positions can be overridden in those, but not in the ‘master’ template (some kind of broken icon for the overridden handle).
- handles are normally box (or rotation) allowing the designer free control of the object.
- anything with box icons (default) will behave as normal, and will be positioned in absolute coordinates on export.
- a lock icon always locks to the template (or guides).
- a pin icon locks to the paper (which grows and shrinks per device template
- an anchor locks to objects
- a spring locks to objects or templates/guides
- if a side is locked (like button 1 top), then not only is its position locked to the template, but the designer can not scale in that direction without removing the lock.
- in the case of button 1, the top corner boxes will only allow horz scaling, thus they are greyed out a bit.
- whenever something is moved to ’snap’ to a guide/template, it automatically locks in that direction. If moved or keyboard nudged, it keeps the lock, but it becomes distance bound.
- locks can be cleared with a shortcut (perhaps ctrl/shift/Z, clear all transforms also breaks custom icons?).
- in button two (bottom left image), the item is locked 5 pixels from the bottom left title safe area (this may be better accomplished with guides?). It is also pinned to the paper on the right. Thus it will grow horizontally to the right. It does this when the designer drags it, per template, and when the width is set in code. The top is not set, therefore it will not change per template (constant height), however it could change with code or by designer adjustment.
- the center icon group is pinned to the center (center icons can be set). In the center this has the same effect as being locked to the center, but had it been offset, the offset would be proportional the the template size.
- these icons are separated by springs. This can be set manually, but it is automatically set when something is distributed.
- Spring or anchor joined objects become a ‘weak’ group. In the center icons case, you could move the third icon independently, but the second would move to keep the distances equal, and pin would change locations. Had the pin been a lock, the first icon would move left to keep distances equal.
Bottom Right Set
- the second icon set (bottom right) has been top aligned. This automatically anchored to tops to each other. moving one icon up or down will move them all, but moving them left or right will be the spring behaviour.
- they are locked to the guide on the right. Moving this guide will move the group (and anything else attached to it). Probably that would move the group ‘as is’ rather than affecting the springs.
- the guide is locked to the template, so as the template grows, the guide will as well.
Templates in Symbols
- templates can be used internally to define symbols. The allow things like minimum size, flow handling, stretch logic etc. So when scaling a symbol defined with a template, you will not necessarily get the regular stretch – eg a grid defined this way may space the icons differently (or even add icons if it is so defined).
Edit in Place
The green outline is the bounds, but it isn’t a template/guide bounds so you can’t lock objects to it. It auto grows and shrinks as you transform objects like normal, but distinguishes from Flowable objects (next). When used, this type of symbol scales like normal objects in Flash do, where flowable objects can have specific flows.
Flowable Symbol – Kern
This is editing an Array or Flowable symbol (not sure what to call these yet, they are like primitives that you use for components, with specific flows and can be made of collections).
This shows a grid of objects, but it could also be used to specify a table row of multiple elements, or a whole table where each row is grouped (that may be separate versions of the same type of element).
The elements have been separated by springs (selecting the first two elements and ‘distributing’ would give this setup for everything). The number of elements can be set with the slider. The designer can drag in different types of symbols and they will be added to the possible symbol types. For auto added types, the user can specify on the property bar whether to add randomly or in order added.
These types can be marked ‘Creatable’, where it is empty at start up and is dynamically filled at runtime (the object is a collection in code, and syntax is basically xx.Add() or xx.Add(Type) if the developer wishes to add different types of objects). This can be restricted by specifying ‘named types’ – eg: only allow symbols with at least an element named ‘bkg’ and a text field named ‘label’. This can be set in the ide as well.
When the blue handle at the bottom right is moved in, the objects compess their width based on the regular handle icon rules.
This version flows down, as indicated by the top left icon, and the arrow at the bottom of the first icon. The elements of the first row are therefore indexed 0,2,4,6.
The blue outline box indicates this is a templated component, so it flows when scaled. When finishing editing the component will retain its set bounds, but if it is scaled later on stage it will flow the same way it did when edited.
Floawable Symbol – Wrap
This is similar to the kern object, but it is set to wrap. Kern or wrap will need to be able to be manually specified, probably if the row count or column count is manually set then it must be a kern object, if not it is a ‘wrap at bounds’ object. That level of specification probably needs to be discovered through use…