SpriteLocalWord
SpriteLocalWord SpriteNumber, Offset, WordValue
 
Parameters:

    SpriteNumber = The Index of the sprite you wish to attach the data to
    Offset = The offset address to place this data
    WordValue = The value to wish to write
Returns: NONE
 

      SpriteLocalWord writes a word value (16bit) into a sprites local data bank.



FACTS:


      * Words values are 16bit, and take two bytes of memory to store them.

      * See CreateSpriteLocals




Mini Tutorial:


      This example creates and deletes a local data bank from a sprite.


  
; Create a Sprite
  CreateSprite 1
  
; Attach a Local data area, 100 bytes long To this sprite
  CreateSpriteLocals 1,100
  
; POke some data into this sprites local buffer
  
; POke a byte value 255 in at address 0
  SpriteLocalByte 1,0,255
  SpriteLocalWord 1,2,64000
  SpriteLocalInt 1,4,1234567
  SpriteLocalFloat 1,8,123.456
  SpriteLocalString 1,12,"Hello World"
  
  Print "Byte:"+Str$(GetSpriteLocalByte(1,0))
  Print "Word:"+Str$(GetSpriteLocalWord(1,2))
  Print "Integer:"+Str$(GetSpriteLocalInt(1,4))
  Print "Float:"+Str$(GetSpriteLocalFloat(1,8))
  Print "String:"+GetSpriteLocalString(1,12)
  
; Display the screen and wait for a key press
  Sync
  WaitKey
  
  



This example wouldoutput something like this.

  
  Byte:255
  Word:64000
  Integer:1234567
  Float:123.456
  String:Hello World
  


 
Related Info: CreateSpriteLocals | DeleteSpriteLocals | GetSpriteLocalByte | GetSpriteLocalFloat | GetSpriteLocalInt | GetSpriteLocalPtr | GetSpriteLocalSize | GetSpriteLocalString | GetSpriteLocalWord | pointer | SpriteLocalByte | SpriteLocalFloat | SpriteLocalInt | SpriteLocalString :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com