GetWorldElements
Numb = GetWorldElements(WorldIndex)
 
Parameters:

    WorldIndex = The Index of the world you wish to query
Returns:

    Numb = The total number of elements captured in this world
 

      The GetWorldElements function returns the number of graphics elements captured to a world.



FACTS:


      * None



Mini Tutorial:


      This example simply creates a world, captures a bunch of randomly positioned dots, then displays the number of elements in this world.


  
; Create WOrld
  MyWorld=NewWorld()
  
; Tell PB to Capture ALL following GFX drawing
; commands to this world
  CaptureToWorld MyWorld
  
; draw 1000 Stars (dots) into this world buffer
  Stars=1000
  W=GetScreenWidth()
  H=GetScreenHeight()
  
  For lp =0 To Stars
     DotC Rnd(w),Rnd(h),RndRGB()
  Next
  
; Tell PB to draw gfx immediately again.
  DrawGFXImmediate
  
; Display the Number of elements captures in this world
  Print "Elements In World:"+Str$(GetWorldElements(MyWorld))
  
;display the screen and wait for a key press
  Sync
  WaitKey
  
  



This example would output.

  
  Elements In World:1001
  

 
Related Info: CameraGrabWorld | CreateWorld | DeleteWorld | GetFreeWorld | GetWorldStatus :
 


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