I have recently found out that the DBPro has become more accessible in the meantime (free version offered) and have been testing some of its features in the meantime, which led me to the problem described in the next paragraph.
When I try to combine 2d and 3d graphics in a certain fashion, I encounter funny results. The idea is:
- to draw some 2d graphics (sprites) first as background (first layer)
- then to draw 3d objects over it (second layer)
- then again to draw some 2d graphics (sprites) over the existing 3d and 2d (third layer)
Simple testing code:
set display mode 800,600,32
backdrop off
load image "media\tiletest01.png",1,0
load image "media\tiletest02.png",2,0
// draw background 2d, 20 tiles
draw to back
for i = 0 to 19
sprite i+1,(0+i*40),200,1
NEXT i
// draw 3d over 2d
make object sphere 1,20
// draw foreground 2d, 20 tiles
draw to front
for i = 0 to 19
sprite i+21,(0+i*40),400,2
NEXT i
do
loop
end
The result is always the same: 2d has been drawn in its own layer and this is being always (depending on the "draw to front" and "draw to back" commands) behind or in front of 3d.
Using the "set sprite priority" didn't seem to help, as this seems to affect sprites only. The commands "draw sprites first/last" seems to work in the same fashion as "draw to front/back", so that didn't really help either.
Is there a possibility to combine graphic styles in the above mentioned order? Any general recommendations or ideas?