GetSpriteOldX
Xpos = GetSpriteOldX(SpriteIndex)
 
Parameters:

    SpriteIndex = The number of the sprite you wish to check
Returns:

    Xpos = The old X position of this sprite
 

      The GetSpriteOldX function reads a sprites old X position. The old position was it's lcoation before it was moved or repositioned.



FACTS:


      * See PositionSprite, MoveSprite





Mini Tutorial:


      Create a sprite, set it's XYZ positions, then read and display its position to the screen.

  
; Create the Sprite
  CreateSprite 1
  
; Set this sprites entities X and Y Positions to 100x,200y
  PositionSpriteXYZ 1100,200,300
  
  Print "Sprites Current/old Positions"
  
; Read and display sprite 1's current position X,Y and
; Z position to the screen.
  Print GetSpriteX(1)
  Print GetSpriteY(1)
  Print GetSpriteZ(1)
  
; display sprite 1's OLD position
  Print GetSpriteOldX(1)
  Print GetSpriteOldY(1)
  Print GetSpriteOldZ(1)
  
  
; Move the sprite 11x,22y
  MoveSprite 111,22
  
  Print "Sprites Current/old Positions after moving"
  
  
; Read and display sprite 1's current position X,Y
; and Z position to the screen.
  Print GetSpriteX(1)
  Print GetSpriteY(1)
  Print GetSpriteZ(1)
  
; display sprite 1's OLD position X,Y and Z position to the screen.
  Print GetSpriteOldX(1)
  Print GetSpriteOldY(1)
  Print GetSpriteOldZ(1)
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  
  



This example would output.

  
  Sprites Current/old Positions
  100.0
  200.0
  300.0
  0.0
  0.0
  0.0
  
  Sprites Current/old Positions after moving
  111.0
  222.0
  300.0
  100.0
  200.0
  300.0
  
  
  


 
Related Info: GetSpriteX | GetSpriteY | GetSpriteZ | MoveSprite | MoveSpriteX | PositionSprite | PositionSpriteX | PositionSpriteXYZ :
 


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