Difference between revisions of "BasicLibs:DrawSprite"

From Doors CS, Doors CSE, and Doors CE Wiki
Jump to navigationJump to search
(Created page with '==Description== Draws a sprite to the buffer at a specified location. The sprite is taken from a Pic file. This will work even if the Pic file is archived. ==Technical Details…')
 
 
(7 intermediate revisions by 2 users not shown)
Line 5: Line 5:
  
 
===Arguments===
 
===Arguments===
real(1, Spr_X, Spr_Y, Spr_Width, Spr_Height, sPIC_Num,sPIC_X, sPIC_Y, Spr_Method, Spr_Flip, Spr_UpDateLCD
+
real(1, Spr_X, Spr_Y, Spr_Width, Spr_Height, sPIC_Num,sPIC_X, sPIC_Y, Spr_Method, Spr_Flip, Spr_UpdateLCD
  
* Spr_X
+
'''Spr_X:''' Upper-left of sprite to be displayed, onscreen, between 0 and 95<br>
** A number between 0 and 95
+
'''Spr_Y:''' Upper-left of sprite to be displayed, between 0 and 63<br>
* Spr_Y
+
'''Spr_Width:''' Sprite width in bytes. An 8-pixel-wide sprite is 1 bye wide , 16 pixels wide is 2 bytes, and so on.<br>
** A number between 0 and 63
+
'''Spr_Height:''' Sprite height in pixels<br>
* Spr_Width
+
'''sPIC_Num:''' The picture number that this sprite is stored in. 1-9 for Pic1-Pic9, 0 for Pic10.<br>
** Sprite width in bytes. So 8 pixels wide, is 1, 16 pixels wide is 2, and so on.
+
'''sPIC_X:''' The offset for the stored sprite in the pic horizontally.  Must be a value from 0-11, and is aligned on bytes (with every 8 pixels).<br>
* Spr_Height
+
'''sPIC_Y:''' The offset for the sprite in the pic vertically.  Does not need to be aligned.<br>
** Sprite height in pixels
+
'''Spr_Method:'''
* sPIC_Num
+
: 0: overwrite
** The picture number that this sprite is stored in. 0-9 for Pic0-Pic9
+
: 1: AND logic
* sPIC_X
+
: 2: OR logic
** The offset for the sprite in the pic horizontally.  Must be a value from 0-11, and is aligned with every 8 bytes.
+
: 3: XOR logic.
* sPIC_Y
+
: 4: Invert Sprite
** The offset for the sprite in the pic vertically.  Does not need to be aligned.
+
'''Spr_Flip:'''
* Spr_Method
+
: 0: No flip
** 0 for overwrite
+
: 1: Horizontal Flip
** 1 for AND logic
+
'''Spr_UpdateLCD:'''
** 2 for OR logic
+
: 0: Do not update
** 3 for XOR logic.
+
: 1: Update the cleared screen
* Spr_Flip
 
** 0: No flip
 
** 1: Horizontal Flip
 
* Update_lcd
 
** 0: Do not update
 
** 1: Update the cleared screen
 
  
 
===Outputs===
 
===Outputs===

Latest revision as of 16:15, 21 January 2011

Description

Draws a sprite to the buffer at a specified location. The sprite is taken from a Pic file. This will work even if the Pic file is archived.

Technical Details

Arguments

real(1, Spr_X, Spr_Y, Spr_Width, Spr_Height, sPIC_Num,sPIC_X, sPIC_Y, Spr_Method, Spr_Flip, Spr_UpdateLCD

Spr_X: Upper-left of sprite to be displayed, onscreen, between 0 and 95
Spr_Y: Upper-left of sprite to be displayed, between 0 and 63
Spr_Width: Sprite width in bytes. An 8-pixel-wide sprite is 1 bye wide , 16 pixels wide is 2 bytes, and so on.
Spr_Height: Sprite height in pixels
sPIC_Num: The picture number that this sprite is stored in. 1-9 for Pic1-Pic9, 0 for Pic10.
sPIC_X: The offset for the stored sprite in the pic horizontally. Must be a value from 0-11, and is aligned on bytes (with every 8 pixels).
sPIC_Y: The offset for the sprite in the pic vertically. Does not need to be aligned.
Spr_Method:

0: overwrite
1: AND logic
2: OR logic
3: XOR logic.
4: Invert Sprite

Spr_Flip:

0: No flip
1: Horizontal Flip

Spr_UpdateLCD:

0: Do not update
1: Update the cleared screen

Outputs

(See Description)