2d image on a 3d game

Blitz3D Forums/Blitz3D Beginners Area/2d image on a 3d game

BLaBZ(Posted 2006) [#1]
ok, im stuck. I have a 3d first person shooter game, I want to be able to put 2d images on the screen such as a healthbar or a picture of coins for money etc.......... I've even tried simply putting text on the screen and you cant see it. I cant figure out whats going on, wether it's being placed somewhere else in the game or what. So somebody help me!


octothorpe(Posted 2006) [#2]
2d graphics commands must be done after RenderWorld and before Flip.


Matty(Posted 2006) [#3]
if you want to do it with 2d graphics, as octothorpe says, do this:


repeat

updategame() ;normal game logic stuff in here
updateworld
renderworld
;draw 2d stuff here, for example it may be worthwhile to have something like this:
update2dstuff() ;function containing all calls to the draw/rect/oval commands you want to do
flip




As a temporary solution 2d graphics used in 3d mode is okay, but it is better to use quads or sprites to do this kind of thing.


SkyCube(Posted 2006) [#4]
I will reccomend using SpriteControl. It is a library that mimics 2d graphics over 3d environment. It was recommended to me in this very forum.

http://www.blitzbasic.com/codearcs/codearcs.php?code=456