Rotatesprite: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
No edit summary
No edit summary
(14 intermediate revisions by 6 users not shown)
Line 1: Line 1:
rotatesprite <x> <y> <z> <a> <tilenum> <shade> <pal> <[[orientation]]> <x1> <x2> <y1> <y2>
'''rotatesprite''' <[[x]]> <[[y]]> <[[zoom]]> <[[ang]]> <[[picnum|tilenum]]> <[[shade]]> <[[pal]]> <[[orientation]]> <x1> <y1> <x2> <y2><br>
'''rotatespritea''' <[[x]]> <[[y]]> <[[zoom]]> <[[ang]]> <[[picnum|tilenum]]> <[[shade]]> <[[pal]]> <[[orientation]]> <[[alpha]]> <x1> <y1> <x2> <y2>


Displays tiles onscreen.
'''rotatesprite''' displays tiles onscreen. This command is only allowed during certain events.


<x> and <y> are on-screen coordinates.
<[[x]]> X coordinate, normally ranged 0-320


<z> is the zoom.  Normal zoom is 65536. Ex: 131072 is zoomed in 2X and 32768 is zoomed out 2X.
<[[y]]> Y coordinate, normally ranged 0-200


<a> is the angle (0 is straight up).
<[[zoom]]> is normally 65536. (ex: 131072 is zoomed in 2X and 32768 is half-sized)


<tilenum> is the tile number.
<[[ang]]> is the angle, normally 0, where 360 degrees corresponds to 2048 [[Build units]]


<shade> is 0 normally but can be any standard shade up to 31 or 63.
<[[tilenum]]> is the tile number.


<pal> can be from 0-255.
<[[shade]]> is 0 normally but can be any standard shade up to 31 or 63.


<[[orientation]]> translucency, masking, etc...
<[[pal]]> can be from 0-255.


<x1>, <y1>, <x2> and <y2> are boundaries on the screen that define where the tile may be drawn.
<[[orientation]]> a [[bitfield]] describing translucency, masking, etc...


Example code:
<[[alpha]]> translucence, 0-255


<pre>
<x1>, <y1>, <x2>, and <y2> are boundaries on the screen that define where the tile may be drawn. If you want to draw a menu, use orientation bit 8, and the boundaries <code>0 0 [[xdim]]-1 [[ydim]]-1</code> as shown in example #2. If you want to draw a weapon, do not use bit 8 and use boundaries <code>[[windowx1]] [[windowy1]] [[windowx2]] [[windowy2]]</code>, as shown in example #1.  The difference is that xdim and ydim stay constant, while the other four shrink depending on the player's [[screen_size|screen size]].
setvar x 30
setvar y 30
setvar z 32768
setvar TEMP 0
setvar tilenum 3350
setvar shade 0
setvar pal 0
setvar [[orientation]] 1 // transparency
rotatesprite x y z TEMP tilenum shade pal [[orientation]] [[windowx1]] [[windowy1]] [[windowx2]] [[windowy2]]
</pre>


Note: This command is similar to the [[myospal]] and [[myospalx]] commands, but with much more control.
setvar x 164
setvar y 176
setvar z 65536
setvar ang 0
setvar tilenum RPGGUN
setvar shade 0
setvar pal 0
setvar orientation 0
'''rotatesprite''' x y z ang tilenum shade pal orientation windowx1 windowy1 windowx2 windowy2
 
This example displays the loading screen with 90% translucence as a kind of "Please Wait" sign:
 
setvarvar xdimminus xdim
subvar xdimminus 1
setvarvar ydimminus ydim
subvar ydimminus 1
'''rotatespritea''' 160 100 65536 0 LOADSCREEN 0 0 8 230 0 0 xdimminus ydimminus
 
Note: This command is similar to the deprecated [[myospal]] and [[myospalx]] commands, but with much more control.


[[Category:EDuke32 specific commands]]
[[Category:EDuke32 specific commands]]
[[Category:Screen drawing commands]]
[[Category:Screen drawing commands]]

Revision as of 02:56, 3 June 2013

rotatesprite <x> <y> <zoom> <ang> <tilenum> <shade> <pal> <orientation> <x1> <y1> <x2> <y2>
rotatespritea <x> <y> <zoom> <ang> <tilenum> <shade> <pal> <orientation> <alpha> <x1> <y1> <x2> <y2>

rotatesprite displays tiles onscreen. This command is only allowed during certain events.

<x> X coordinate, normally ranged 0-320

<y> Y coordinate, normally ranged 0-200

<zoom> is normally 65536. (ex: 131072 is zoomed in 2X and 32768 is half-sized)

<ang> is the angle, normally 0, where 360 degrees corresponds to 2048 Build units

<tilenum> is the tile number.

<shade> is 0 normally but can be any standard shade up to 31 or 63.

<pal> can be from 0-255.

<orientation> a bitfield describing translucency, masking, etc...

<alpha> translucence, 0-255

<x1>, <y1>, <x2>, and <y2> are boundaries on the screen that define where the tile may be drawn. If you want to draw a menu, use orientation bit 8, and the boundaries 0 0 xdim-1 ydim-1 as shown in example #2. If you want to draw a weapon, do not use bit 8 and use boundaries windowx1 windowy1 windowx2 windowy2, as shown in example #1. The difference is that xdim and ydim stay constant, while the other four shrink depending on the player's screen size.

setvar x 164
setvar y 176
setvar z 65536
setvar ang 0
setvar tilenum RPGGUN
setvar shade 0
setvar pal 0
setvar orientation 0
rotatesprite x y z ang tilenum shade pal orientation windowx1 windowy1 windowx2 windowy2

This example displays the loading screen with 90% translucence as a kind of "Please Wait" sign:

setvarvar xdimminus xdim
subvar xdimminus 1
setvarvar ydimminus ydim
subvar ydimminus 1
rotatespritea 160 100 65536 0 LOADSCREEN 0 0 8 230 0 0 xdimminus ydimminus

Note: This command is similar to the deprecated myospal and myospalx commands, but with much more control.