GetLevelWidth
Width = GetLevelWidth(MapIndex, LevelIndex)
 
Parameters:

    MapIndex = The Index of the Map you wish to query a level within
    LevelIndex = The index of the level you wish to query.
Returns:

    Width = Width of level in tiles
 

     The GetLevelWidth function will returns the width of a level in tiles.


FACTS:


      * The returned value is in TILES not pixels. You can compute the number of pixels using the GetLevelAbsWidth & GetLevelAbsHeight functions.




Mini Tutorial:


      This example shows how to first create a Map & Level, then displays the size information about this level.



  
; Get a free Map index
  MyMap=GetFreeMap()
  
; Create a map with provision for 5 levels
  CreateMap MyMap,5
  
; Create level 1 of size 100x,200y, and attach
; it To MYMap
  CreateLevel MyMap,1,100,200
  
; Display the Info about the map and it's level's
  Print "Map Index:"+Str$(MyMap)
  Print "# of Levels MYMap has:"+Str$(GetMapLevels(MyMap))
  
; Display the info about Level 1 in MyMap
  Print "Map Level Status:"     +Str$(GetLevelStatus(MyMap,1))
  Print "Map Level Width:"     +Str$(GetLevelWidth(MyMap,1))
  Print "Map Level Height:"     +Str$(GetLevelHeight(MyMap,1))
  
; Display the screen and wait for a key to be pressed
  Sync
  WaitKey
  



This example would output.

  
  Map Index:1
  # of Levels MYMap has:5
  Map Level Status:1
  Map Level Width:100
  Map Level Height:200
  

 
Related Info: CreateLevel | GetLevelHeight | ResizeLevel :
 


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