Template:Screentext flags: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
Fox (talk | contribs)
No edit summary
No edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<noinclude>{{Template}}</noinclude>
The following values are used with [[screentext]] and [[qstrdim]].
The following values are used with [[screentext]] and [[qstrdim]].


Line 28: Line 30:
| No || 2048 || TEXT_YJUSTIFY || [[Wikipedia:Justification (typesetting)|Justify]] text in the Y direction, using <ybetween> for the total height (since the actual distance will be calculated automatically). Compatible with TEXT_YBOTTOM and TEXT_YCENTER.
| No || 2048 || TEXT_YJUSTIFY || [[Wikipedia:Justification (typesetting)|Justify]] text in the Y direction, using <ybetween> for the total height (since the actual distance will be calculated automatically). Compatible with TEXT_YBOTTOM and TEXT_YCENTER.
|-
|-
| No || 4096 || TEXT_LINEWRAP || Enable a hackish internal line wrapping feature used by some text in the executable (such as multiplayer messages) that will wrap a string back to its starting X position at the point when a character would go off the screen. This flag has no effect if any alignment flags are used or if the <block angle> is not a multiple of 512, which includes 0--perfectly horizontal or vertical.
| No || <font color="gray">4096</font> || <font color="gray"><RESERVED></font> || <font color="gray">Do not use.</font>
|-
|-
| No || 8192 || TEXT_UPPERCASE || Force the case of all letters in the string to uppercase.
| No || 8192 || TEXT_UPPERCASE || Force the case of all letters in the string to uppercase.
Line 38: Line 40:
| No || 65536 || TEXT_LITERALESCAPE || No parsing will be done for palette escape sequences so they will show up as actual text. This is useful if you have '' followed by a number that you actually want to display on the screen, such as exponentiation.
| No || 65536 || TEXT_LITERALESCAPE || No parsing will be done for palette escape sequences so they will show up as actual text. This is useful if you have '' followed by a number that you actually want to display on the screen, such as exponentiation.
|-
|-
| No || 131072 || TEXT_BACKWARDS || Iterate through the string backwards. (TEXT_LITERALESCAPE is highly recommended because there is not a separate pass to escape the palette sequences forwards.)
| No || <font color="gray">131072</font> || <font color="gray"><RESERVED></font> || <font color="gray">Do not use.</font>
|-
|-
| No || 262144 || TEXT_GAMETEXTNUMHACK || All numerals will display as if they have a TEXT_XOFFSETZERO of the width of the '0' minus one. For the standard blue font, this value would be 8. This is useful if you have some string including a number value (such as a countdown timer) that you want to display without the place values shifting due to variable width tiles, particularly '1'.
| No || 262144 || TEXT_CONSTWIDTHNUMS || All numerals will display as if they have a TEXT_XOFFSETZERO of the width of the '0' minus one. For the standard blue font, this value would be 8. This is useful if you have some string including a number value (such as a countdown timer) that you want to display without the place values shifting due to variable width tiles, particularly '1'.
|-
|-
| No || 524288 || TEXT_DIGITALNUMBER || Special tile order: starting at '0' instead of 'A'. Using this flag with quotes containing anything other than numbers may give you undefined behavior. (Recommended tile numbers: DIGITALNUM (#2472), THREEBYFIVE (#3010))
| No || 524288 || TEXT_DIGITALNUMBER || Special tile order: starting at '0' instead of 'A'. Using this flag with quotes containing anything other than numbers may give you undefined behavior. (Recommended tile numbers: DIGITALNUM (#2472), THREEBYFIVE (#3010))
Line 47: Line 49:
|-
|-
| No || 2097152 || TEXT_GRAYFONT || Special tile order: gray font. To parallel the above flag, the red font serves as the lowercase letters, so TEXT_UPPERCASE is recommended. The primary difference compared to using the above flag with the lowercase flags is that the gray font has its own set of numerals. The red font's punctuation is still used. (Recommended tile number: #2966)
| No || 2097152 || TEXT_GRAYFONT || Special tile order: gray font. To parallel the above flag, the red font serves as the lowercase letters, so TEXT_UPPERCASE is recommended. The primary difference compared to using the above flag with the lowercase flags is that the gray font has its own set of numerals. The red font's punctuation is still used. (Recommended tile number: #2966)
|-
| No || 4194304 || TEXT_NOLOCALE || Text will not be translated by the [[localization]] DEF command.
|-
| No || 8388608 || TEXT_VARHEIGHT || Alters the positioning of the text in the x and y direction, shifting it by half the size of the tile, depending on the zoom value of the text, if and only if RS_TOPLEFT is not set.
|-
| No || 16777216 || TEXT_CENTERCONSTWIDTH || Center glyphs within their allotted region and respect xbetween between chars in constant width mode.
|-
|-
|}
|}


{| {{Collapse}}
| <strong>Defines</strong>
|-
|
  define TEXT_XRIGHT                      0x00000001
  define TEXT_XRIGHT                      0x00000001
  define TEXT_XCENTER                    0x00000002
  define TEXT_XCENTER                    0x00000002
Line 72: Line 84:
  define TEXT_BIGALPHANUM                0x00100000
  define TEXT_BIGALPHANUM                0x00100000
  define TEXT_GRAYFONT                    0x00200000
  define TEXT_GRAYFONT                    0x00200000
define TEXT_NOLOCALE                    0x00400000
define TEXT_VARHEIGHT                  0x00800000
define TEXT_CENTERCONSTWIDTH            0x01000000
|}


<noinclude>[[Category:Templates]]</noinclude>
<noinclude>[[Category:Templates]]</noinclude>
<includeonly>[[Category:Pages with templates]]</includeonly>
<includeonly>[[Category:Pages with templates]]</includeonly>

Latest revision as of 03:33, 7 January 2024

This page is a template.
This page was created to be included in other pages.


The following values are used with screentext and qstrdim.

Exposed Value Label Description
No 1 TEXT_XRIGHT Right-align text on the x-axis. For example, you could display text at x=320 with this flag and the string's right edge would be on the right edge of the screen.
No 2 TEXT_XCENTER Center-align text on the x-axis. For example, you could display text at x=160 with this flag and the string would be perfectly horizontally centered.
No 4 TEXT_YBOTTOM Bottom-align text on the y-axis. For example, you could display text at y=200 with this flag and the string's bottom edge would be on the bottom edge of the screen.
No 8 TEXT_YCENTER Center-align text on the y-axis. For example, you could display text at y=100 with this flag and the string would be perfectly vertically centered.
No 16 TEXT_INTERNALSPACE If you are unsure what to specify for the <xspace> parameter, this flag will allow EDuke32 to make its own determination. Don't use this unless you have no idea whatsoever. The <xspace> value will be added to the internal result.
No 32 TEXT_TILESPACE The <xspace> parameter will be determined using the width of the tile after '~'. Good for custom fonts. (NB: <xbetween> is added to spaces just like any other character.) The <xspace> value will be added to the result.
No 64 TEXT_INTERNALLINE If you are unsure what to specify for the <yline> parameter, this flag will allow EDuke32 to make its own determination. Don't use this unless you have no idea whatsoever. The <yline> value will be added to the internal result.
No 128 TEXT_TILELINE The <yline> parameter will be determined using the height of the tile after '~'. Good for custom fonts. The <yline> value will be added to the result.
No 256 TEXT_XOFFSETZERO Calculate spacing between characters from the left edge instead of the right. In other words, <xbetween> is used as a constant width for the characters in the string and the potentially variable widths of the tiles displayed in the string are ignored.
No 512 TEXT_XJUSTIFY Justify text in the X direction, using <xbetween> for the total width (since the actual distance will be calculated automatically). Compatible with TEXT_XRIGHT and TEXT_XCENTER.
No 1024 TEXT_YOFFSETZERO Calculate spacing between line from the top edge instead of the bottom. In other words, <ybetween> is used as a constant height for the lines in the string and the potentially variable heights of the tiles displayed in the string are ignored.
No 2048 TEXT_YJUSTIFY Justify text in the Y direction, using <ybetween> for the total height (since the actual distance will be calculated automatically). Compatible with TEXT_YBOTTOM and TEXT_YCENTER.
No 4096 <RESERVED> Do not use.
No 8192 TEXT_UPPERCASE Force the case of all letters in the string to uppercase.
No 16384 TEXT_INVERTCASE Invert the case of the letters in the string. Combine with TEXT_UPPERCASE to produce all-lowercase output.
No 32768 TEXT_IGNOREESCAPE Palette escape sequences (# or ##) will have no effect. (See definequote.)
No 65536 TEXT_LITERALESCAPE No parsing will be done for palette escape sequences so they will show up as actual text. This is useful if you have followed by a number that you actually want to display on the screen, such as exponentiation.
No 131072 <RESERVED> Do not use.
No 262144 TEXT_CONSTWIDTHNUMS All numerals will display as if they have a TEXT_XOFFSETZERO of the width of the '0' minus one. For the standard blue font, this value would be 8. This is useful if you have some string including a number value (such as a countdown timer) that you want to display without the place values shifting due to variable width tiles, particularly '1'.
No 524288 TEXT_DIGITALNUMBER Special tile order: starting at '0' instead of 'A'. Using this flag with quotes containing anything other than numbers may give you undefined behavior. (Recommended tile numbers: DIGITALNUM (#2472), THREEBYFIVE (#3010))
No 1048576 TEXT_BIGALPHANUM Special tile order: main menu red font. As in v1.3D, the gray font serves as the lowercase letters, so TEXT_UPPERCASE is recommended. (Recommended tile number: BIGALPHANUM (#2930))
No 2097152 TEXT_GRAYFONT Special tile order: gray font. To parallel the above flag, the red font serves as the lowercase letters, so TEXT_UPPERCASE is recommended. The primary difference compared to using the above flag with the lowercase flags is that the gray font has its own set of numerals. The red font's punctuation is still used. (Recommended tile number: #2966)
No 4194304 TEXT_NOLOCALE Text will not be translated by the localization DEF command.
No 8388608 TEXT_VARHEIGHT Alters the positioning of the text in the x and y direction, shifting it by half the size of the tile, depending on the zoom value of the text, if and only if RS_TOPLEFT is not set.
No 16777216 TEXT_CENTERCONSTWIDTH Center glyphs within their allotted region and respect xbetween between chars in constant width mode.
Defines
define TEXT_XRIGHT                      0x00000001
define TEXT_XCENTER                     0x00000002
define TEXT_YBOTTOM                     0x00000004
define TEXT_YCENTER                     0x00000008
define TEXT_INTERNALSPACE               0x00000010
define TEXT_TILESPACE                   0x00000020
define TEXT_INTERNALLINE                0x00000040
define TEXT_TILELINE                    0x00000080
define TEXT_XOFFSETZERO                 0x00000100
define TEXT_XJUSTIFY                    0x00000200
define TEXT_YOFFSETZERO                 0x00000400
define TEXT_YJUSTIFY                    0x00000800
define TEXT_LINEWRAP                    0x00001000
define TEXT_UPPERCASE                   0x00002000
define TEXT_INVERTCASE                  0x00004000
define TEXT_IGNOREESCAPE                0x00008000
define TEXT_LITERALESCAPE               0x00010000
define TEXT_BACKWARDS                   0x00020000
define TEXT_GAMETEXTNUMHACK             0x00040000
define TEXT_DIGITALNUMBER               0x00080000
define TEXT_BIGALPHANUM                 0x00100000
define TEXT_GRAYFONT                    0x00200000
define TEXT_NOLOCALE                    0x00400000
define TEXT_VARHEIGHT                   0x00800000
define TEXT_CENTERCONSTWIDTH            0x01000000