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 above object

Author
Message
freight dog
16
Years of Service
User Offline
Joined: 12th Aug 2008
Location: Probably in a airplane
Posted: 15th Aug 2008 01:07
Hello I'm experiencing that day my algrabra teacher always warned me about.......

Anyways Im putting text above a object using


Works Great except text is only above the object at a certain distance. So basicly I cant figure out the formula to make the text appear a constant (or close to constant) Height above the object regardless of distance.

Thanks in Advance
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 15th Aug 2008 10:23 Edited at: 15th Aug 2008 10:24
Well this doesn't require algebra, but the easiest method would be to make your own dbObjectScreenX/Y function(s) that allow for vertical offsets, as the same calculations would be done in those commands anyway so you lose almost no speed. Luckily for you someone has already made such a function here: http://forum.thegamecreators.com/?m=forum_view&t=129810&b=22, you may also want to use dbCenterText() instead.

freight dog
16
Years of Service
User Offline
Joined: 12th Aug 2008
Location: Probably in a airplane
Posted: 15th Aug 2008 16:19
Thanks man Ill give that a shot when I get home. By the way your work looks top notch keep up the good work
freight dog
16
Years of Service
User Offline
Joined: 12th Aug 2008
Location: Probably in a airplane
Posted: 16th Aug 2008 06:23
Forgive my inexperience but I cant seem to get his function to work for me. Any chance you can give me a simple example of how to use his function?

Thanks
Swift
16
Years of Service
User Offline
Joined: 17th Aug 2008
Location:
Posted: 18th Aug 2008 11:14
Well im not entirely sure but woudlnt you just print the text with respect to the objects x and y positions. Im pretty sure you have to know where the object is to be able to draw it so you should have these variables stored somewhere. then simply:



i just tested this and it works fine.
the text may appear to shift depending on which direction the object is moving. this is most likely due to the dbText function being run before the object has been moved. To fix this all you need to do is ensure that the dbText event is after any position changes for the object it is following.
freight dog
16
Years of Service
User Offline
Joined: 12th Aug 2008
Location: Probably in a airplane
Posted: 18th Aug 2008 17:34
Yea thats the way I was doing it but was trying to figure out a way to get the text static above object so it doesn't shift when object moves or the camera moves kinda like in Everquest.

Login to post a reply

Server time is: 2024-09-30 05:28:03
Your offset time is: 2024-09-30 05:28:03