only ever supported by Sprite and BitmapText. Handle it globally, using
m_size. This way, an actor only needs to set m_size to support alignment.
This means alignment can be set for non-drawing ActorFrames, if a size
is set explicitly. This allows stretching from the border of a frame
without playing games with extra nested frames. "setsize,100,100;valign,4;zoomx,.5"
This adds an extra matrix multiply. This will only happen for actors
actually set to non-centered alignment, which is the exception.
BitmapText still overrides this behavior a bit. Alignment for text
does two things: changes the alignment of the bounding box vs. the
X/Y position (the generic behavior), and changes the alignment of
the text within the bounding box.
yet decided whether these should be -1.0 ... +1.0, indicating
"fully left aligned" and "fully right aligned", or 0.0 ... 1.0,
indicating "anchor to this fractional position in m_size".
It may become the latter.)
they can both have parameters stashed in a table, and they both play
stuff out of the actor command list. Merge them; now the only
difference between playing and broadcasting a command is that playing
plays recursively on a tree and broadcasting sends to all subscribers.
The distinction between "messages" and "commands" is cosmetic now;
everything is a message. The only thing special about commands intended
to be received as a broadcast is the "Message" suffix, which subscribes it.
Each actor type needs to evaluate attributes; only a few do. Strings
are handled with the "@foo()" notation.
Instead, after loading an XML file for loading as an actor,
precompile all XML attributes as Lua expressions.
The primary difference to code is:
- previously, Attr="string" would act as a string if it was being
read as one. Now, specify Attr='"string"'. Attr="@string" is
a shorthand. (note that @strings will not be parsed as Lua
strings, so can not use Lua escape characters)
- previously, Attr="@func()" would evaluate func(), and the value
of the attribute would be the return value of the function. This
was only supported for a few attributes. Now, say Attr="func()",
and this will work for all fields.
- Attributes of other types are unchanged, except that all attributes
may be Lua expressions, eg. Width="SCREEN_WIDTH".
- Attributes names ending with "Command" are special, like metrics.
Prefix "%" to disable this.
This brings XML handling in line with metric handling. (This is an intermediary
step; I have another idea that follows from this that should eliminate the annoying
"'foo'"/"@foo".)