Commodore‎ > ‎BASIC‎ > ‎Keywords‎ > ‎

RSPRITE

Keyword Abbreviation Token (hex) Version(s) Classification
RSPRITE RSP{Shift+R} CE 06 7.0 Function

  Syntax  
RSPRITE ( sprite , info )
 
Parameters Type Legal Value(s) Note(s)
sprite Unsigned Byte 1 ~ 8   
info Unsigned Byte
  1. get enable
  2. get chipColor
  3. get behind
  4. get expandX
  5. get expandY
  6. get multiColor
 
Returns Type Value(s) Note(s)
value Integer
0 or 1 (most)
1 ~ 16 (chipColor)
 
  Purpose  
Return information about a sprite.
 
  Remarks  
The RSPRITE function complements the SPRITE command/statment.  See SPRITE for a complete description of the various values you may get.  But in summary, you may get the following info about a sprite:
  1. enable: is the sprite being displayed? (1=yes, 0=no)
  2. chipColor: what is the sprite's unique color? (1 to 16, same as COLOR)
  3. behind: can the sprite appear "under" screen elements? (1=yes, 0=no)
  4. expandX: is the sprite double-width? (1=yes, 0=no)
  5. expandY: is the sprite double-height? (1=yes, 0=no)
  6. multiColor: is the sprite in multi-color mode? (1=yes, 0=no [high-resolution mode])
 
If sprite or info is omitted, either is an invalid expression, or extra parameters are given, then SYNTAX ERROR occurs.  If either parameter is not numeric, TYPE MISMATCH ERROR occurs; you may manually convert strings with VAL.  Any floating-point parameter is automatically converted with INT.  If the result is not a Legal Value (see table above), then ILLEGAL QUANTITY ERROR occurs.
 
Examples:
PRINT RSPRITE("1",3)

?TYPE MISMATCH ERROR 
READY.
PRINT RSPRITE(1,3) :REM sprite X expand?
 0                 no
 
READY.
PRINT RSPRITE(1,4) :REM sprite Y expand?
 0                 no

READY.
PRINT RSPRITE(1,1) :REM sprite 1 color is?
 1                 black

READY.
 
  Compare With  
 
  Contrast With  
 
  See Also  

© H2Obsession, 2014
Comments