GetSpriteWidth
Width = GetSpriteWidth(SpriteIndex)
 
Parameters:

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

    Width= The width in pixels of this sprites image
 

      GetSpriteWidth returns the current width of this sprite in pixels. The sprites width is taken from them it's currently assigned image.


FACTS:


      * If the sprite hasn't been assigned an image (See SpriteImage) GetSpriteWidth will return zero.



Mini Tutorial:


      Create a sprite, create an assign it an image, then read and display the current size of the image and sprite.

  
; create a blank image 78x by 99y pixels.
  BlankImage=NewImage(78,79)
  
; Create a Sprite using the blank image at 50x,50y
  MySprite=NewSprite(50,50,BlankImage)
  
  
; Display the Size of the IMage..
  Print "Images Size"
  Print GetImageWidth(BlankImage)
  Print GetImageHeight(BlankImage)
  
; Display the Size of the Sprite..
  Print "Sprites Size"
  Print GetSpriteWidth(MySprite)
  Print GetSpriteHeight(MySprite)
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  




This example would output.

  
  Images Size
  78
  79
  Sprites Size
  78
  79
  

 
Related Info: GetSpriteHeight | GetSpriteImage | SpriteImage :
 


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