GetMapBlocks
NumberOfBlocks = GetMapBlocks(MapIndex)
 
Parameters:

    MapIndex = The index of the map you wish to query
Returns:

    NumberOfBlocks = The number of blocks this map has defined
 

      The GetMapBlocks function returns the number of blocks this map contains.



FACTS:

      * Depending upon the block format, Maps are either limited to 1023 blocks (Video formatted blocks) or 4096 for FX/AFX formatted blocks



Mini Tutorial:


      The example creates a MAP and block set, then displays the related information about the created block set.

  
; Create a map with provision for 5 levels
  MyMap=NewMap(5)
  
; Create some blank blocks for this map
  CreateMapGFX MyMap,30,20,10,RGB(0,0,255)
  
; Display the info about this maps created block set
  Print "Number OF Blocks:"+Str$(GetMapBlocks(mymap))
  Print "Block Status:"     +Str$(GetMapBlockStatus(MyMap))
  Print "Block Width:"     +Str$(GetMapBlockWidth(MyMap))
  Print "Block Height:"     +Str$(GetMapBlockHeight(MyMap))
  Print "Block Mask Colour:"     +Str$(GetMapMaskColour(MyMap))
  
; Display the screen and wait for a key to be pressed
  Sync
  WaitKey
  
  



This example would output.

  
  Number OF Blocks:10
  Block Status:1
  Block Width:30
  Block Height:20
  Block Mask Colour:255
  

 
Related Info: CreateMapGfx | GetMapBlockStatus | LoadMapGfx | MakeMapGfx :
 


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