LevelDrawMode
LevelDrawMode MapIndex, LevelIndex, DrawMode
 
Parameters:

    MapIndex = The Index of the Map you wish to set a levels render mode
    LevelIndex = The index of the level you wish to set to transparent
    DrawMode = The DrawMode that this level should use
Returns: NONE
 

     LevelDrawMode allow you to sets a levels combined draw mode.



      Draw Mode Bits

      %001 = Level Solid
      %010 = Level Transparent
      %100 = Level Animated




FACTS:


      * Note Solid & Transparent draw mode bits can't be combined.




Mini Tutorial:


      This example creates a maps level, and then draws the solid and transparent versions of this level at the mouse pointers current position, as if the level were a sprite.


  
  
; Set Width & Height variables of the Map tiles
  TileWidth=20
  Tileheight=20
  
; Create a map with provision for 5 levels
  MyMap=NewMap(5)
  
; Create some empty graphics blocks for MyMAP
  CreateMapGFX MyMap,TileWidth,TileHeight,10,RGB(0,0,0)
  Cls RGB(0,0,0)
  For lp=1 To 9
   ; draw a randomly coloured box
     BoxC 0,0,TileWidth/2,TileHeight/2,1,RndRGB()
   ; Copy the box image into MyMap
     GetMapBlk MyMap, lp, 0,0
  Next
  
  
; Create level 1
  CreateLevel MyMap,1,10,10
  
; Randomly Fill the level with Tiles
  For Ylp=0 To GetLevelWidth(myMap,1)
     For Xlp=0 To GetLevelWidth(myMap,1)
        PokeLevelTile MyMap,1,Xlp,Ylp,RndRange(1,10)
     Next
  Next
  
; Make a copy of level 1 as level 2
  CloneLevel MyMap,1,MyMap,2
  
; Set Level #1 as solid
  LevelDrawMode MyMap,1,%001
  
; Set LEvel #2 as transparent
  LevelDrawMode MyMap,2,%010
  
  
; Start of Do/Loop
  Do
   ; clear the screen to black
     Cls RGB(255,20,30)
     
     
   ; Read the mouse position
     mx#=MouseX()
     my#=MouseY()
     
     
   ; Draw Level #1
     DrawMap MyMap,1,mx#-200,my#-100
     CenterText mx#-100,my#-120,">> SOLID MAP <<"
     
   ; DRaw the Level #2
     DrawMap MyMap,2,mx#+200,my#-100
     CenterText mx#+300,my#-120,">> TRANSPRENT MAP <<"
     
   ; Display the screen and loop back to the DO
     Sync
  Loop
  
  



This example would output.

  
  no Output
  

 
Related Info: CreateLevel | CreateMap | DrawMap :
 


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