ResizeLevel
ResizeLevel MapIndex, LevelIndex, Width, Height
 
Parameters:

    MapIndex = The Index Identifier of the Map you wish to alter this level within.
    LevelIndex = The index of the level you wish to resize.
    Width = The new width of the level in tiles
    Height = The new Height of the level in tiles
Returns: NONE
 

     Resizelevel will resize an existing created a level without destroying it's contents.



FACTS:


     * Levels can not be drawn until the maps graphics tiles have been loaded/created.

     * The Level Width parameter is in TILES not pixels.

     * The Level Height parameter is in TILES not pixels.






Mini Tutorial:


     This example shows how to first create a Map & Level, then resize it. While displaying the size information about this level before and after the resize.



  
; 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))
  
; Resize Level #1 inMymap to 300wide by 400 high
  ResizeLevel MyMap,1,300,400
  
; Display the info about Level 1 in MyMap again
  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
  Map Level Status:1
  Map Level Width:300
  Map Level Height:400
  

 
Related Info: CloneLevel | CopyLevel | CreateLevel | CreateMap | DeleteLevel | GetLevelStatus :
 


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