DrawMapBlk
DrawMapBlk MapIndex, BlockIndex, Xpos, Ypos, DrawMode
 
Parameters:

    MapIndex = The Index Identifier of the Map you wish to draw a Block from.
    BlockIndex = The index of the Block you wish to draw.
    Xpos = The X coordinate to draw the block at
    Ypos = The Y coordinate to draw the block at
    DrawMode = How to draw the block (0= solid, 1 = transparent)
Returns: NONE
 
      DrawMapBlk allows the user to draw any of maps block graphics to the current surface, which might be the screen or an image.


FACTS:


      * None




Mini Tutorial:


      This example creates a map and a block set, then displays them using the DrawMapBlk command.

  
; Set Width & Height variables of the Map tiles
  TileWidth=16
  Tileheight=16
  
  
; 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)
  
  For lp=1 To 10
   ; draw a randomly coloured box
     BoxC 0,0,TileWidth-1,TileHeight-1,1,RndRGB()
   ; Copy the box image into MyMap
     GetMapBlk MyMap, lp, 0,0
  Next
  
; Draw the created blocks to the Screen
  For lp =0 To GetMapBlocks(MyMap)
     DrawMapBlk MyMap,lp,lp*TileWidth,100,0
  Next
  
  
; Display the screen and wait keya key press
  Sync
  WaitKey
  
  



This example would output.

  
  no Output
  

 
Related Info: CreateMap | DrawMap | GetMapBlk :
 


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