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.

AppGameKit Studio Chat / Sprite and Text

Author
Message
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 21st Mar 2020 13:26 Edited at: 21st Mar 2020 15:00
Hello forum,

I want to create some onscreen objective distance with a text and a sprite, something like in Doom Eternal. The text and the sprite must move in relation to the camera but maintaining it's location.

I am not sure if my explanation is good enough. Here is a video as an example:



Thank you very much!
www.alexmatei.com
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 21st Mar 2020 16:25
i watched the first few minutes and am not sure of the effect you're looking for.
you might get more help by directing us to examples somewhere in the 2 hr video?
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 21st Mar 2020 18:50 Edited at: 21st Mar 2020 18:51
Virtual Nomad,

You are right. Photo attached

www.alexmatei.com

Attachments

Login to view attachments
Raven
19
Years of Service
User Offline
Joined: 23rd Mar 2005
Location: Hertfordshire, England
Posted: 21st Mar 2020 23:36
You're looking for an "Objective" Marker approach...
That's actually pretty easy, but does require a little "Setup" when you're Developing the Level itself.

What you want to do is use Placeholder Objects... typically speaking it's easiest to just use Cubes with a Transparent Texture.
You'll realistically want to be using these for things like Location Points anyways; such-as Player Spawn, Monster Spawn, Weapon Spawn, Pick Up Spawn, etc.

As such you'll want to be naming these after what you want them to be.
At Load, you can go through the list of Sub-Mesh and "Hide" or "Disable Rendering" for them... after all, what they're there for is just as Location Markers

You can still use Commands like GetObjectScreenX and GetObjectScreenY, even if they're not Rendering to where they will be On-Screen... you can easily create Text and Sprite Image at any time; then simply Render them at said Location when they've been activated.
In fact you can even have a Distance Calculation based upon the Locator Position - Player Position to discover the Difference and translate that into whatever Units (Metres, Yards) you're using as a basis.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 22nd Mar 2020 01:32 Edited at: 22nd Mar 2020 01:36
after looking at the effect in the vid, i don't think you need an object.

once you define your Objective Coords (X#,Y#,Z#), take a look at the GetScreenXFrom3D() and GetScreenYFrom3D() commands.

if the resultant ...From3D X/Y Coords are on the screen (or close to it, taking the size of the sprite/text object into account), you'll have a point of reference for which to position your sprite and/or text object.

this isn't pretty but i think you'll get the point:


hope that helps

Login to post a reply

Server time is: 2024-04-26 07:25:39
Your offset time is: 2024-04-26 07:25:39