Template:Orientation: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 5: Line 5:
'''1'''  - translucency level one (66% opacity).
'''1'''  - translucency level one (66% opacity).


'''2'''  - scaling on 320-200 coordinates. It's considered internal in the case of CON commands because the CON interface automatically sets it when you use functions calling rotatesprite (as well as various text functions).
'''2'''  - scaling on 320-200 coordinates (deprecated). It's considered internal in the case of CON commands because the CON interface automatically sets it when you use functions calling rotatesprite (as well as various text functions).


'''4'''  - 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.
'''4'''  - 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'''  - clips the sprite you're drawing to startumost/startdmost.
'''8'''  - 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''' - forces the center of the sprite you're drawing to its top-left if set. If not, its center as set in editart will be drawn at the specified coordinates.
'''16''' - 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''' - is translucency level two (33% opacity). It won't work if '''1''' is not set.
'''32''' - is translucency level two (33% opacity). It won't work if '''1''' is not set.
Line 17: Line 17:
'''64''' - forces masking off if set. It discards translucency too.
'''64''' - forces masking off if set. It discards translucency too.


'''128''' - "permanent" tile, probably of no use to CON programmers
'''128''' - "permanent" tile (deprecated).


'''256''' - Align to the left (GL widescreen support)
'''256''' - Align to the left (GL widescreen support)

Revision as of 12:48, 31 May 2011

orientation is a parameter used in several of the screen drawing commands, including digitalnumber and rotatesprite

orientation is a bitfield, the flags of which determine how a sprite is drawn. Here are the known bits and what they do. There may be others:

1 - translucency level one (66% opacity).

2 - scaling on 320-200 coordinates (deprecated). It's considered internal in the case of CON commands because the CON interface automatically sets it when you use functions calling rotatesprite (as well as various text functions).

4 - 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 - 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 - 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 - is translucency level two (33% opacity). It won't work if 1 is not set.

64 - forces masking off if set. It discards translucency too.

128 - "permanent" tile (deprecated).

256 - Align to the left (GL widescreen support)

512 - Align to the right (GL widescreen support)

1024 - Stretch to screen resolution (distorts aspect ratio; this is the behavior of rotatesprite prior to widescreen awareness)

As with cstat, the bit values can be added together and used in combination. For example, orientation 33 (32+1) is transparency level two, and orientation 5 (4+1) is transparency level one with inverted Y coordinates.