2d 3d draw..

Blitz3D Forums/Blitz3D Programming/2d 3d draw..

cash(Posted 2007) [#1]
still working on inventory code.
Whats the best way to
when i press a key it brings up an "inventory" screen
the contents will be the collected items as sprites
I then want to be able to click on the sprites etc.

I need to know the best way to ensure the sprites are always positioned in the same place infront of the camera, like a 2d draw.

I could do it with images rather than sprites but the interaction becomes more complex when selecting the chosen item.

Am I making sense, I hope so...


Vertigo(Posted 2007) [#2]
Search the forums for "Sprite Control". I think it may work well for this. There is also the fast image dll.


Matty(Posted 2007) [#3]
nSprite 2 works well. Basically all the 2d commands from blitzbasic are implemented in 3d.


D4NM4N(Posted 2007) [#4]
If you create a plane (or a cube) and position it at the perfect distance & scale from the camera so it just fills the screen top and bottom.

Then set it to entityorder +1 (in front) and then hide it using alpha 0. Then create a texture and use it as the drawspace using setbuffer texturebuffer(texture). Then to get your screen you can alpha-fade it in and out as needed.

Because a texture can only be square, i reccommend making the menus/inventory square too (so you can still see the 3d around the edges) and using a 1024x1024 texture, or 512x512 if big enough. If using 1024 dont rely on single pixel detail as there will be some shrinkage due to the real screen res being 768.

Using sprites works too and looks better, but is much more fiddily. I wrote a sprite thingy here http://www.d-grafix.com?page=sourcecode which calculates a virtual drawspace of 640x480, over the 3d using sprites regardless of physical resolution (but it isnt perfect and wont work right in non standard res like widescreen, but may give you some ideas)


Abrexxes(Posted 2007) [#5]
http://blitzbasic.pytalhost.de/viewtopic.php?t=88 ;)


http://www.abrexxes.huntingsoftware.de/temp2/demo17.zip
(This is a Demo with Draw3D and a 3dGUI, but at the moment the GUI is beta and makes Draw3D 3 times slower, only in the 800*600 modes the mouse works correkt)