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.

DarkBASIC Professional Discussion / Text location on object positoin?

Author
Message
SkyBox
14
Years of Service
User Offline
Joined: 23rd Apr 2012
Location:
Posted: 23rd Apr 2012 22:24
Ok, so I am creating an educational game as a project. I am making a typing game where I need the text to follow the object position (go and search the game "type of the dead"). In this game, objects are coming toward the player with text hovering over them. The player has to type the word displayed to destroy the object.

My problem here is on how to declare the location of the text reletive to the object (like a health bar hovering over an npc).

I am a very novice programmer but I know the code would go somewhere along the line as follows:

text x,y,z, 10 (to say the text is located where the object is)
text "snapdragon" (text that will hover over the object)
load object "objects/asteroid1",10 (the object number is 10)

Apologies in advance if I am not giving all the information needed. Anyway, does anyone here have experience with text locations?
Andrew_Neale
16
Years of Service
User Offline
Joined: 3rd Nov 2009
Location: The Normandy SR-2
Posted: 24th Apr 2012 00:38 Edited at: 24th Apr 2012 00:42
You can use the 'object screen x' and 'object screen y' commands to grab the screen coordinates of an object.




Previously TEH_CODERER.

Login to post a reply

Server time is: 2026-07-10 09:48:51
Your offset time is: 2026-07-10 09:48:51