BDS Software

Z-Index for Maps

For browser-based games, I'm going to form my game maps by using the HTML5 <canvas> element and then placing images at various
(x, y) positions on that canvas.

For larger games, i.e. desktop-based rather than browser-based games, I plan to use Qt5's QGraphicsScene element in a manner similar to that of the HTML5 <canvas> element in browser-based games -- I will place various images at different (x,y) positions on the QGraphicsScene.

In either case, some images will overlap (or even totally obscure) other images. The z-indices of the images determine which image or images are visible to the user under such circumatances.

For example, given image1 and image2, if these two images are placed on the canvas with the following code: