Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Displaying images on top of a 3d view

Author
Message
scott1686
15
Years of Service
User Offline
Joined: 27th Jan 2009
Location:
Posted: 18th Feb 2009 23:12
Is there a way to make an image show up on the screen in a 3D game? I tried creating a sprite and positioning it at (20, 20) so that it would always show in the top left corner of the screen, but it's not showing up. Thanks.
Pharoseer
17
Years of Service
User Offline
Joined: 21st Feb 2007
Location: Right behind you
Posted: 19th Feb 2009 00:20
Hey Scott,

Without seeing code I can only guess that there is a problem with the image you're loading. Make sure the path is correct (in case you have it in a subfolder for example).

Sprites are considered 3D by the engine and by default are drawn last. So, barring problems with the images not loading, they should appear on top of everything else. They also have no need of being re-applied each frame. They handle it themselves.

Hope this helps,

-Frank
scott1686
15
Years of Service
User Offline
Joined: 27th Jan 2009
Location:
Posted: 19th Feb 2009 00:53
This is what I have so far:



I know the path is right since I managed to get the image to be textured on an object. Do I have to do something with dbGetImage, and if so, what do I do? The dimensions of the image is 76 by 76, and I tried (0, 0, 76, 76) and (0, 0, 75, 75) as parameters to dbGetImage but each time I got an error. Thanks.
Pharoseer
17
Years of Service
User Offline
Joined: 21st Feb 2007
Location: Right behind you
Posted: 19th Feb 2009 01:32
If you're able to use the image then just calling dbSprite() as you have should do it. You're not calling dbDrawSpritesFirst() by any chance are you?

Another thing I just thought of would involve the currently active bitmap. Bitmap 0 is the screen. If you use dbLoadBitmap() or dbCreateBitmap() it will change the active bitmap so you won't be able to see things being rendered.

Either way, I've attached a very simple project that displays 2 sprites while rotating a cube. Hopefully it'll help answer your questions.

-Frank

Attachments

Login to view attachments
scott1686
15
Years of Service
User Offline
Joined: 27th Jan 2009
Location:
Posted: 19th Feb 2009 02:01
Ahh I figured it out, I was using a constant for the sprite and for some reason I had assigned it to 0 instead of 1, oops. Thanks for the help!

Login to post a reply

Server time is: 2024-09-30 19:29:57
Your offset time is: 2024-09-30 19:29:57