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 / Text on-top of Sprites on-top of 3D objects........ WHA?!?!?!

Author
Message
helpfull programmer
15
Years of Service
User Offline
Joined: 30th Jul 2009
Location:
Posted: 10th May 2010 20:03
Hello one and all ^.^

You guys have been amazing and I have come across a problem... I can't seem to get "Text on-top of Sprites on-top of 3D objects", very weird.

I can get text onto of 2d Sprites and 2D sprites on-top of 3D objects but when I try and combine the functions it all get screwed up and I think it goes in this order:

2D Sprites
Text
3D objects

Thank you in advance!
from helpfullprogrammer.
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 10th May 2010 20:13 Edited at: 10th May 2010 20:16
dont use dbDrawSpritesFirst/Last, i believe those are for 2D, and were not made to be compitable with 3d, you can paste an image, and draw text on it:


note that using this way does not mess with rendering order, so objects are still drawn behind the text/sprite(s)

Malboro Jones
14
Years of Service
User Offline
Joined: 10th Dec 2009
Location: Wales - UK
Posted: 10th May 2010 20:13
Probably because you've set it to draw sprites on top which probably also mean on top of text

Don't make war, make tea.
helpfull programmer
15
Years of Service
User Offline
Joined: 30th Jul 2009
Location:
Posted: 10th May 2010 20:21
Thank you everyone! but sorry Hassan but I have around 1000 sprites and using dbHideSprite/dbPasteSprite seems a bit OTT and a vast memory hog, are you sure there isn't an easier way? like draw text to front???
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 10th May 2010 20:27
what do you mean? it makes code messy? you can simply use this instead of dbSprite:


if you mean it reduces performance, i dont think it really does that, did you try?

haliop
User Banned
Posted: 10th May 2010 20:29
if you are doing something like Name Tags like in most multiplayer games, you can simple create a Plain and texture it with the Text, then rotation it towards the camera oriantaion making it look like a 2D sprite its pretty easy and cost less from the computer
3d is faster then 2d , dont ask me why it just is.
helpfull programmer
15
Years of Service
User Offline
Joined: 30th Jul 2009
Location:
Posted: 10th May 2010 20:29
On a big scale it does, as it will have to call a function and another function for every sprite you wan't to make... it just seems silly you have to do it this way... and it will lag a lot more if I have to do it 1000 times, and I have to paste the sprite every time I sync the screen...

Thank you for helping though!
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 10th May 2010 20:34 Edited at: 10th May 2010 20:34
unless you create you text with sprites, i think it's the only way, or do what haliop said

helpfull programmer
15
Years of Service
User Offline
Joined: 30th Jul 2009
Location:
Posted: 10th May 2010 20:37
Thank you very much
helpfull programmer
15
Years of Service
User Offline
Joined: 30th Jul 2009
Location:
Posted: 10th May 2010 20:38
how do you texture the plain with text???? I know how to texture plains as I use them in my game already, do you have to use a picture or can you use text from a char*

Thank you so much guys!!!
from helpfullprogrammer.
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 10th May 2010 20:53
Well i didnt try rendering to textures yet, but however it's done, it will surely be slower than the first method ( pasting ) if you will re-create the texture every frame

haliop
User Banned
Posted: 10th May 2010 21:23 Edited at: 10th May 2010 21:24
oh its simple actually
take a look at this example:


what happens , is you have a plain that actually act like a sprite , you always see it in the same way such as a sprite cause it will always face your position.

hope this can help.
Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 15th May 2010 14:37
When I do that my program breaks on // dbGetImage(1,0,0,dbTextWidth(Text)+5,dbTextHeight(Text)+5);


"Unhandled exception" and "Acces violation"

Niels Henriksen
www.tales-of-the-realms.com
if Microsoft can sell software with bugs, so can I.
haliop
User Banned
Posted: 15th May 2010 20:01 Edited at: 15th May 2010 20:08
ok i can see the problem clearly my bad.




you can also , declare the bitmap Size

helpfull programmer
15
Years of Service
User Offline
Joined: 30th Jul 2009
Location:
Posted: 15th May 2010 22:20
haliop!
Your explaining this really well, but how big does the bitmap have to be, as you just put "dbCreateBitmap(/*not zero*/ 1);" which dosen't really mean anything, do we make it the same size as the screen, the text???? Thanks in advance as I am also getting "Unhandled exception" and "Acces violation".

Thank you very much
from helpfullprogrammer.
haliop
User Banned
Posted: 15th May 2010 22:51
the bitmap can be from 1 x 1 to (as i know) 1024 x 1024 in order to work good, i have tried to work with higher bitmap resulotions but i got some errors.

ok , this is a part of a code i have, maybe i have forgot something but this is how i do it , and it works without a problem.

helpfull programmer
15
Years of Service
User Offline
Joined: 30th Jul 2009
Location:
Posted: 15th May 2010 22:55
As you posted it I sussed it out myself ^.^ Thank you very much for the quick reply and you can soon catch some updates of my game "vorii" on my you-tube channel:
http://www.youtube.com/watch?v=ePNxDlZ2H7Q

happy-programming!
from helpfullprogrammer.
haliop
User Banned
Posted: 15th May 2010 22:59
dude thats an awesome trailer.
Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 16th May 2010 01:06
I replaced btnImg with 1 and still get the same errror

dbGetImage(btnImg,0,0,80,20); // Saving the New Image as a New id.

When I remove this like my program runs but when the line is active then it dies..

Niels Henriksen
www.tales-of-the-realms.com
if Microsoft can sell software with bugs, so can I.
helpfull programmer
15
Years of Service
User Offline
Joined: 30th Jul 2009
Location:
Posted: 16th May 2010 01:07
Thank you, just getting the 3D chat and weaving skill working and I will make a walk through

by any chance, are you the person on you-tube with the 2D text???
http://www.youtube.com/watch?v=6swXAEeoIkY

Speak soon!
from helpfullprogrammer.
helpfull programmer
15
Years of Service
User Offline
Joined: 30th Jul 2009
Location:
Posted: 16th May 2010 01:08
wow, long thread -.-
haliop
User Banned
Posted: 16th May 2010 07:29
Quote: "I replaced btnImg with 1 and still get the same errror

dbGetImage(btnImg,0,0,80,20); // Saving the New Image as a New id."


yeah i forgot to change it .. still getting an error?
how is that possible...
helpfull can you run it?

i honestly dont know whats the problem...
what verstion of darkGDK are you using?
Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 16th May 2010 11:37
I found out the problem was not there...

I tried to update to 7.4a and now I cant start the default project

Niels Henriksen
www.tales-of-the-realms.com
if Microsoft can sell software with bugs, so can I.
haliop
User Banned
Posted: 16th May 2010 12:06
what errors does it give you?

Login to post a reply

Server time is: 2024-11-19 23:38:02
Your offset time is: 2024-11-19 23:38:02