well, today i bought B+ and it realy kick butt. However I
still don't get this...
Quote :"if you set drawing operations to the BackBuffer() you will NOT see any of them until you call FLIP. "
UH-UH! in this code below I see everything before flipping
the whole buffer. I even turnd around my monitor several
times, but the backbuffer was still visible :)
Info : It is drawing a map for a run and jump game.
--- begin of code ---
Global block=32 ; tile hight and width in pixels
Dim wall(35) ; main wall tiles 32 x 32
Graphics 320,240,32
; setup background
SetBuffer BackBuffer()
bg1 = LoadImage("gfx\bg1.png")
DrawImage (bg1,0,0)
Color 0,0,0 Rect 0,224,320,16
For piece=0 To 35 ; load main walls
wall(piece) = LoadAnimImage("gfx\tiles.bmp",32,32,piece,1) ; assign bmp piece to wall dim
Next
; draw main walls
For y=0 To 6 For x=0 To 9
Read wallmap
For datavalue=0 To 35
If wallmap=datavalue Then wallnum=datavalue ; checks data and declare dim to wall
Next
MaskImage (wall(wallnum)),255,0,255 ; pick chroma key
DrawImage (wall(wallnum),x*block,y*block) ; draw wallpiece on grid
Next
Next
Restore wallmap
.wallmap
Data 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data 12, 0, 0, 0, 0, 0, 0, 0, 0,11
Data 16, 6, 6, 9, 5, 7, 6,10, 9,14
-- end of code ---
Errr.. help?
still don't get this...
Quote :"if you set drawing operations to the BackBuffer() you will NOT see any of them until you call FLIP. "
UH-UH! in this code below I see everything before flipping
the whole buffer. I even turnd around my monitor several
times, but the backbuffer was still visible :)
Info : It is drawing a map for a run and jump game.
--- begin of code ---
Global block=32 ; tile hight and width in pixels
Dim wall(35) ; main wall tiles 32 x 32
Graphics 320,240,32
; setup background
SetBuffer BackBuffer()
bg1 = LoadImage("gfx\bg1.png")
DrawImage (bg1,0,0)
Color 0,0,0 Rect 0,224,320,16
For piece=0 To 35 ; load main walls
wall(piece) = LoadAnimImage("gfx\tiles.bmp",32,32,piece,1) ; assign bmp piece to wall dim
Next
; draw main walls
For y=0 To 6 For x=0 To 9
Read wallmap
For datavalue=0 To 35
If wallmap=datavalue Then wallnum=datavalue ; checks data and declare dim to wall
Next
MaskImage (wall(wallnum)),255,0,255 ; pick chroma key
DrawImage (wall(wallnum),x*block,y*block) ; draw wallpiece on grid
Next
Next
Restore wallmap
.wallmap
Data 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data 12, 0, 0, 0, 0, 0, 0, 0, 0,11
Data 16, 6, 6, 9, 5, 7, 6,10, 9,14
-- end of code ---
Errr.. help?