mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 09:28:15 +03:00
Replace PR_COLORGLYPH_BRI(a) and PR_ALPHA(a) with PR_BRIGHTNESS(a)
There used to be two ways of fading in/out text in VVVVVV:
- Local code that modifies the R, G and B values of the text
- Keeping the RGB values the same and using the alpha channel
The latter approach is only used once, for [Press ENTER to return to
editor]. The former approach causes problems with colored (button)
glyphs: there's no way for the print function to tell from the RGB
values whether a color is "full Viridian-cyan" or "Viridian-cyan faded
out 50%", so I added the flag PR_COLORGLYPH_BRI(value) to tell the
print function that the color brightness is reduced to match the
brightness of colored glyphs to the brightness of the rest of the text.
However, there were already plans to make the single use of alpha
consistent with the rest of the game and the style, so PR_ALPHA(value)
could be removed, as well as the bit signifying whether the brightness
or alpha value is used. For the editor text, I simply copied the "Press
{button} to teleport" behavior of hiding the text completely if it
becomes darker than 100/255.
Another simplification is to make the print function handle not just
the brightness of the color glyphs while local code handled the
brightness of the normal text color, but to make the print function
handle both. That way, the callsite can simply pass in the full colors
and the brightness flag, and the flag name can be made a lot simpler as
well: PR_BRIGHTNESS(value).
This commit is contained in:
committed by
Misa Elizabeth Kai
parent
d1f6c1adf2
commit
716a241b79
@@ -53,7 +53,8 @@ A not-technically-exhaustive list of all flags (which are defined in Font.h):
|
||||
- PR_FONT_LEVEL Use level-specific font (room names, cutscenes, etc)
|
||||
- PR_FONT_8X8 Use 8x8 font no matter what
|
||||
- PR_BRIGHTNESS(value) Use this brightness 0-255 (this value is mixed with
|
||||
r, g and b for an alpha effect)
|
||||
r, g and b for an alpha effect, and accounts for
|
||||
colored glyphs correctly)
|
||||
- PR_BOR Draw a black border around the text
|
||||
- PR_LEFT [DEFAULT] Left-align text/place at X coordinate
|
||||
- PR_CEN Center-align text relative to X (X is center)
|
||||
|
||||
Reference in New Issue
Block a user