Overlapping canvases

BlitzMax Forums/BlitzMax Beginners Area/Overlapping canvases

Farflame(Posted 2009) [#1]
I'm missing something fundamental here. I wanted to put a background on my game, with a couple of canvases, one to show a map, one to show a radar. I don't think I can put the background directly onto the window, so I tried to create another canvas, the size of the entire window, then paint the background onto that, then repaint the two canvases over the top, but the radar one isn't showing now. For that matter, a couple of combo boxes I put on the screen aren't showing either.

The way I'm trying to do it is, during the Event_Gadgetpaint event, I draw the background, then the two canvases in that order. I'm doing a Setgraphics Canvasgraphics(Thiscanvas) followed by a Cls, the update, then a flip, for each canvas.

Basically I need a fuller tutorial on canvases, or can somebody show me how to do two overlapping canvases in a short example?


Brucey(Posted 2009) [#2]
A Canvas is for rendering of Graphics. You are going to have display issues placing any other gadgets over the top of one.


Farflame(Posted 2009) [#3]
So would there be another way of putting a background behind my canvas? i.e Put a background onto the main window, then put the canvas ontop of that?


TomToad(Posted 2009) [#4]
You should be able to create a panel the entire size of the window and use SetPanelPixmap() to set the background. Then just put your other gadgets and canvases onto the pixmap.


jsp(Posted 2009) [#5]
Don't know which OS you use, here is an example for win:
Does it work for you? (Press start to start animation, resize window, or new for another instance)

http://jsp.logiczone.de/downloads/CanvasOnCanvas.exe