Screen-sized Sprites

Blitz3D Forums/Blitz3D Programming/Screen-sized Sprites

Jay Mattis(Posted 2003) [#1]
Is there any way that I can create a sprite that I can place right in front of the camera that has a GraphicsWidth()xGraphicsHeight() sized texture on it so that I can draw 2d right to the screen? What I'm trying to do is draw right to the screen with whatever I draw being semi-transparent so that I can see-through to the 3d underneath.


_PJ_(Posted 2003) [#2]
Yes. To create a HUD type affair, it may be easier to use a series of smaller sprites.

However, all you need is to position the sprite in the correct place in front of the camera (dependant on camera scale and sprite scale) then parent it to the camera. This way the sprite will remain on top.


Rob Farley(Posted 2003) [#3]
And set the entityorder so it's always drawn last.

I would agree with several sprites rather than just 1, especially as people will select different screen res.


jhocking(Posted 2003) [#4]
The use of a single sprite covering the entire screen can also cause a drop in framerate due to fill rate. If there isn't much else on screen at the same time you should be fine (I use sprites covering the screen all the time for my front-end menu) but if you are trying to overlay a HUD in your game a single sprite covering the entire screen would be a framerate killer.


Jay Mattis(Posted 2003) [#5]
This is what I'm trying to do. I've got a kind of "board" like a game board. That's in 3d but it's position never moves and I want to draw 2d on top of that game board. However, I don't want the 2d to cover the pieces that are on the game board. So, I wanted to make it a sprite and make it half transparent and draw the 2d on the texture. I've got two problems with that. One, is that the sprite seems to be in a different place depending on the resolution and the other is it makes the board significantly darker. Any ideas?


DJWoodgate(Posted 2003) [#6]
Depends on what you are drawing in 2d really. I suppose you have discounted using a masked texture overlay mapped over the whole board or each cell. I can't recall how well using a masked texture as an overlay works now though, but it might be worth a go.