Closed benloh closed 7 months ago
I added in the help text for textAlign and textJustify and moved those to advanced.
I tested with a character that did and did not display a graph. All seems to work.
The one minor issue I found was that text color doesn't re-set. That is, if you have a call that changes the color to say red, it will stay red on reset. However, you can just explicitly set the color to white in init and this resolves it. So ... not a big deal. Otherwise, looks good to me!
The one minor issue I found was that text color doesn't re-set. That is, if you have a call that changes the color to say red, it will stay red on reset. However, you can just explicitly set the color to white in init and this resolves it. So ... not a big deal.
Yeah that one's harder to fix elegantly. Since we try to avoid setting/changing the color unnecessarily, the color will be retained. There are probably other feature props that are not being reset either.
Going to merge for now.
Addresses #783
This partially implements styling for character text.
Due to the complexity of implementing selection menu options for wizards, it is not possible at this time to use a selection menu to select alignment and justification values. Instead, you'll have to use a bitwise flags to combine settings.
The Graphing feature now has three feature properties:
textAlign
textJustfication
textColor
To set text alignment:
Notes
setToOption
will be added in the future once we add support for defining and using built-in gvars options for features.Alignment
Alignments are set via bitwise flags that you can combine to determine the position. e.g. to set
TOP
use1
; e.g. to useTOP + CENTER
addCENTER: 16
toTOP: 1
or17
. Use the table below for convenience.Labels are set to appear just outside of the sprite bounding box so they don't cover the sprite. The exception is the MIDDLE + CENTER value which will appear in the middle of the sprite.
The default alignment is BOTTOM + CENTER.
Justification
Justification only works for multiline text.
The default justification is CENTER.
Color
Use the
setToColor
method to enable the color picker. Previously we applied a slightly transparent alpha to the text to soften the text, but the color picker does not allow alphas.Note to Future Ben for reference: See 2023-01107-wip-text-styles c86cae8 stash for how SlotEditor_Block might handle options in built-in features gvar options.