SpriteQuantity
SpriteQuantity NumberOfSprites
 
Parameters:

    NumberOfSprites = The max Sprite index range (1 to MAX)
Returns: NONE
 

      SpriteQuantity lets you expand/contract the maximum number Sprite Indexes available. So if you ever run out, you can request more at any time.




FACTS:


      * You can also lower the sprite quantity if you like (which can save a little memory), but any sprite outside of the new range will be deleted.

      * Sprite quantity indexes are limited to 1 to 2^24 (over 24 million). Most programs would be lucky to use a few hundred sprites, so that's just overkill.

      * The sprite quantity only applies to users manually assigning sprite indexes (ie CreateSprite). However Dynamic sprite creation using NewSprite & GetFreeSprite for example, will automatically resize the sprite quantity (the container) for you. So in those situations, SpriteQantity is largely irrelevant.





Mini Tutorial:


      This example simply gets the current sprite quantity, displays it, doubles the quantity and displays it again.

  
; Read the Default Sprite range
  AvailableSprites=GetSpriteQuantity()
  
; display this value to the screen
  Print AvailableSprites
  
; double the available quantity
  SpriteQuantity AvailableSprites*2
  
; display the new Sprite quantity
  Print GetSpriteQuantity()
  
; display the screen and wait for a key press
  Sync
  WaitKey
  
  



This example would output (This depends upon what version of PB your running, so the results may differ).

  
  1500
  3000
  

 
Related Info: CreateSprite | GetFreeSprite | GetSpriteQuantity | NewSprite :
 


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