Pre-defined values: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
Fox (talk | contribs)
No edit summary
Fox (talk | contribs)
No edit summary
Line 1: Line 1:
== Globalflags ==
== Globalflags ==


Used with [[globalflags]] userdef or [[DEF_Language#globalflags|globalflags]] DEF command
Used with [[globalflags]] userdef or [[DEF_Language#globalflags|globalflags]] DEF command.


{| {{prettytable}}
{| {{prettytable}}
Line 28: Line 28:
== Globalgameflags ==
== Globalgameflags ==


Used with [[globalgameflags]] userdef or [[DEF_Language#globalgameflags|globalgameflags]] DEF command
Used with [[globalgameflags]] userdef or [[DEF_Language#globalgameflags|globalgameflags]] DEF command.


{| {{prettytable}}
{| {{prettytable}}
Line 50: Line 50:
  define DUKE3D_NO_HARDCODED_FOGPALS      0x00000002
  define DUKE3D_NO_HARDCODED_FOGPALS      0x00000002
  define DUKE3D_NO_PALETTE_CHANGES        0x00000004
  define DUKE3D_NO_PALETTE_CHANGES        0x00000004
== Orientation ==
Used with [[rotatesprite]], [[screentext]] and other screen drawing commands.
{| {{prettytable}}
!Value!!Label!!Description!!
|-
| 1
| RS_TRANS1
| Translucency level one (66% opacity).
|-
| 2
| RS_AUTO
| Scaling on 320-200 coordinates. This is implicitly applied to all CON screen drawing commands, but including it in your bitfields is recommended for clarity and portability of your code.
|-
| 4
| RS_YFLIP
| Used to invert Y coordinates. Combine this bit with an angle of 1024 (using rotatesprite) and the tile will appear to have inverted X coordinates. If you want inversion for both the X and Y coordinates, simply set the angle (again, with rotatesprite) to 1024 and do not use this bit.
|-
| 8
| RS_NOCLIP
| Causes the sprite to be not affected by the screen size (using the + or - commands). This is usefull, for example, when displaying a status bar.
|-
| 16
| RS_TOPLEFT
| Forces the center of the sprite you're drawing to its top-left if set. It also ignores the x-y offset of the tile.
|-
| 32
| RS_TRANS2
| Translucency level two (33% opacity). It won't work if | 1|  is not set.
|-
| 64
| RS_NOMASK
| Forces masking off if set. It discards translucency too.
|-
| 128
| RS_PERM
| "Permanent" tile (deprecated).
|-
| 256
| RS_ALIGN_L
| Align to the left (widescreen support)
|-
| 512
| RS_ALIGN_R
| Align to the right (widescreen support)
|-
| 1024
| RS_STRETCH
| Stretch to screen resolution (distorts aspect ratio; this is the behavior of rotatesprite prior to widescreen awareness)
|-
| 2048
|
| Always interpret coordinate values as having "full" precision, [[shiftvarl|bit-shifted left by 16]], so that 20971520x13107200 corresponds to 320x200. See [[rotatesprite16]].
|-
|}
define RS_TRANS1                        0x00000001
define RS_AUTO                          0x00000002
define RS_YFLIP                        0x00000004
define RS_NOCLIP                        0x00000008
define RS_TOPLEFT                      0x00000010
define RS_TRANS2                        0x00000020
define RS_NOMASK                        0x00000040
define RS_PERM                          0x00000080
define RS_ALIGN_L                      0x00000100
define RS_ALIGN_R                      0x00000200
define RS_STRETCH                      0x00000400
==Text Properties==
Used with [[screentext]].
{| {{prettytable}}
!Value!!Label!!Description!!
|-
|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.
|-
|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.
|-
|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.
|-
|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.
|-
|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.
|-
|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.
|-
|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.
|-
|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.
|-
|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.
|-
|512
|TEXT_XJUSTIFY
||[[Wikipedia:Justification (typesetting)|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.
|-
|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.
|-
|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.
|-
|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.
|-
|8192
|TEXT_UPPERCASE
|Force the case of all letters in the string to uppercase.
|-
|16384
|TEXT_INVERTCASE
|Invert the case of the letters in the string. Combine with TEXT_UPPERCASE to produce all-lowercase output.
|-
|32768
|TEXT_IGNOREESCAPE
|Palette escape sequences (^# or ^##) will have no effect. (See [[definequote]].)
|-
|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.
|-
|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.)
|-
|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'.
|-
|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))
|-
|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))
|-
|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)
|-
|}
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
[[Category:Scripting documentation]]

Revision as of 06:00, 10 December 2019

Globalflags

Used with globalflags userdef or globalflags DEF command.

Value Label Description
1 GLOBAL_NO_GL_TILESHADES Disable tile shades (aka palette emulation) in OpenGL
2 GLOBAL_NO_GL_FULLBRIGHT Disable fullbright colors in OpenGL
4 GLOBAL_NO_GL_FOGSHADE Make visibility the same for all shades in OpenGL. With this, positive shades won't appear darker with visibility, and negative shades won't appear brighter (and negative shades will have virtually no difference from shade zero). As a result, positive shades won't look even darker with distance, while negative shades will look the
define GLOBAL_NO_GL_TILESHADES          0x00000001
define GLOBAL_NO_GL_FULLBRIGHT          0x00000002
define GLOBAL_NO_GL_FOGSHADE            0x00000004

Globalgameflags

Used with globalgameflags userdef or globalgameflags DEF command.

Value Label Description
1 DUKE3D_NO_WIDESCREEN_PINNING Disable widescreen orientation bits for weapon sprites drawn on screen. Enable this if you are using weapon sprites extended on the sides (similar to 20th Anniversary World Tour).
2 DUKE3D_NO_HARDCODED_FOGPALS Disable the four fog palettes. By default Eduke32 will create four new palettes, with IDs ranging from 26 to 29 (however it varies depending of the size of the lookup table).
4 DUKE3D_NO_PALETTE_CHANGES Disable changes to the game palette. By default Eduke32 will attempt to replace the magenta color used for transparency with the color closest to black.
define DUKE3D_NO_WIDESCREEN_PINNING     0x00000001
define DUKE3D_NO_HARDCODED_FOGPALS      0x00000002
define DUKE3D_NO_PALETTE_CHANGES        0x00000004

Orientation

Used with rotatesprite, screentext and other screen drawing commands.

Value Label Description
1 RS_TRANS1 Translucency level one (66% opacity).
2 RS_AUTO Scaling on 320-200 coordinates. This is implicitly applied to all CON screen drawing commands, but including it in your bitfields is recommended for clarity and portability of your code.
4 RS_YFLIP Used to invert Y coordinates. Combine this bit with an angle of 1024 (using rotatesprite) and the tile will appear to have inverted X coordinates. If you want inversion for both the X and Y coordinates, simply set the angle (again, with rotatesprite) to 1024 and do not use this bit.
8 RS_NOCLIP Causes the sprite to be not affected by the screen size (using the + or - commands). This is usefull, for example, when displaying a status bar.
16 RS_TOPLEFT Forces the center of the sprite you're drawing to its top-left if set. It also ignores the x-y offset of the tile.
32 RS_TRANS2 1| is not set.
64 RS_NOMASK Forces masking off if set. It discards translucency too.
128 RS_PERM "Permanent" tile (deprecated).
256 RS_ALIGN_L Align to the left (widescreen support)
512 RS_ALIGN_R Align to the right (widescreen support)
1024 RS_STRETCH Stretch to screen resolution (distorts aspect ratio; this is the behavior of rotatesprite prior to widescreen awareness)
2048 Always interpret coordinate values as having "full" precision, bit-shifted left by 16, so that 20971520x13107200 corresponds to 320x200. See rotatesprite16.
define RS_TRANS1                        0x00000001
define RS_AUTO                          0x00000002
define RS_YFLIP                         0x00000004
define RS_NOCLIP                        0x00000008
define RS_TOPLEFT                       0x00000010
define RS_TRANS2                        0x00000020
define RS_NOMASK                        0x00000040
define RS_PERM                          0x00000080
define RS_ALIGN_L                       0x00000100
define RS_ALIGN_R                       0x00000200
define RS_STRETCH                       0x00000400

Text Properties

Used with screentext.

Value Label Description
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
8192 TEXT_UPPERCASE Force the case of all letters in the string to uppercase.
16384 TEXT_INVERTCASE Invert the case of the letters in the string. Combine with TEXT_UPPERCASE to produce all-lowercase output.
32768 TEXT_IGNOREESCAPE Palette escape sequences (^# or ^##) will have no effect. (See definequote.)
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.
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.)
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'.
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))
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))
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)
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