Video flags are a series of toggles that determine the properties of graphics drawn during SRB2 runtime, whether in the form of text or patches. These flags are listed here as reference, as they are used by both the console command
cechoflags as well as Lua's HUD library functions. Also listed in this page are several constants related to the video flags used for masking and bit-shifting, which are detailed in their respective sections and are relevant only for SOC/Lua.
Video flag bits and masks
Unlike with other types of flags, the video flags are divided into individual sections which take up specific bits in the final combined value. These are detailed in the table below, along with the corresponding mask constants (and their values) to represent these bits:
|Bits||Mask name||Mask value
||These bits are reserved for an 8-bit integer parameter internally. For example, when drawing individual characters in a string, this determines which character in the font is to be drawn. You cannot set nor control these bits using |
||These bits determine how to scale text and patches.|
||These bits determine text spacing types.|
||These bits determine the color of text.|
||These bits determine the alpha or translucency of text and patches.|
||These bits determine miscellaneous flags. These flags can be combined with each other freely, unlike flags from the other sections.|
List of flags
These flags control how text or patches are scaled in-game. However, their effects may or may not have an effect depending on the screen resolution – by default the size of graphics is determined by the ratio of the current resolution to the default resolution (320×200). (Having none of the scaling flags set corresponds with
Note the given X/Y positions of the top left corner of text or patches will also be scaled, unless
V_NOSCALESTART is given.
These flags do not allow the effects of
V_SNAPTORIGHT to function.
|| Text or patches are not scaled. This will cause them to be sized as if the resolution was the default of 320×200, while still retaining the their starting positions for the resolution currently being used, assuming |
This flag corresponds with
|| Text or patches are scaled to 1/2 the normal scale. Will have no effect for resolutions 640×400 and smaller.
This flag corresponds with
|| Text or patches are scaled to 2/3 the normal scale. Will have no effect for 320×200.
This flag corresponds with
These flags control the type of text spacing used when drawing text. These flags do not apply for patches. By default, all spaces are 4 pixels in width, and a character's width is determined by the width of the graphic used.
||Spaces are 6 pixels in width, all other characters have a width matching their real image width. Old 2.1 style spacing.|
||All characters are 8 pixels wide, and spaces are 4 pixels wide. This is the spacing previously used by all versions of SRB2 prior to 2.1, and some things (menu options, for one) still use it.|
||All characters are 8 pixels wide, spaces included.|
These flags control the color of text. These are not related to skin colors, as color-remapping for text is done differently compared to color-remapping for sprites. These flags do not apply for patches.
Note that the effects of these flags override any and all color codes within the text string, coloring all text drawn in the corresponding color for the flag. For applying colors in specific parts of text rather than all, see SOC > Custom colors or SOC > Hexadecimal input for SOC, and Lua > Special characters for Lua.
These flags determine the alpha or translucency of text and patches; if none are used they will be opaque. Some of these depend on the value of the console variable
translucenthud instead of having a fixed translucency. Note that
0x000C0000 will all make the patch/text invisible.
||Text or patches are 10% translucent.|
||Text or patches are 20% translucent.|
||Text or patches are 30% translucent.|
||Text or patches are 40% translucent.|
|Text or patches are 50% translucent.|
||Text or patches are 60% translucent.|
||Text or patches are 70% translucent.|
||Text or patches are 80% translucent.|
||Text or patches are 90% translucent.|
|| Text or patches will be adjusted to be half as opaque (twice as translucent) as the corresponding translucency determined by |
|| Text or patches will be adjusted to the corresponding translucency determined by |
|| Text or patches will be adjusted to be twice as opaque (half as translucent) as the corresponding translucency determined by |
These flags can be combined with each other freely; however, some flags may not be compatible with other flags from this or other sections.
|| Makes |
||Line breaks in text move the start of the next line of text down by 8 pixels rather than 12. Since text characters are normally 8 characters tall, this means lines of text will have no distance between them vertically. This has no effect for patches.|
|| Account for the offsets in patches when drawing strings. Does not allow |
||(Strings only) Allows use of lowercase letters, instead of forcing letters to be all-uppercase by default.|
|| (Patches only) Flips the patch across the X axis (horizontally). This flag has no effect if |
|| Text or patches snap to the top edge of the screen in non-green resolutions. This means that the top of the string or patch will remain the same distance from the top edge of the screen as if it were using a green resolution. This flag has no effect if |
|| Text or patches snap to the bottom edge of the screen in non-green resolutions. This means that the bottom of the string or patch will remain the same distance from the bottom edge of the screen as if it were using a green resolution. This flag has priority over |
|| Text or patches snap to the left edge of the screen in non-green resolutions. This means that the left end of the string or patch will remain the same distance from the left edge of the screen as if it were using a green resolution, and text will be left-aligned. This flag has no effect if |
|| Text or patches snap to the right edge of the screen in non-green resolutions. This means that the right end of the string or patch will remain the same distance from the right edge of the screen as if it were using a green resolution, and text will be right-aligned. This flag has priority over |
||Don't clamp texture horizontally in OpenGL mode. This flag has no effect in Software mode.|
||Don't clamp texture vertically in OpenGL mode. This flag has no effect in Software mode.|
|| Do not scale the text or patch's starting position, i.e., the top-left corner of the text/patch. This will cause it to be placed as if the resolution was the default of 320×200, while still retaining the size of the text/patch for the resolution currently being used, assuming |
This flag does not allow the effects of
||Draws text and patches half the screen further downwards than normal, for displaying Player 2's HUD in splitscreen mode.|
These constants are used to bit-shift integer values to the bits for specific types of video flags, or to shift the flags back down to their integer values:
||12|| Number of bits to shift up to convert integers 1–7 to the color flags |
||16|| Number of bits to shift up to convert integers 1–9 to the alpha flags |