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 Classic Chat / [SOLVED] Fix object to screen

Author
Message
Game_Code_here
4
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 14th Sep 2020 04:02
I wonder if there is a way to fix object to the screen like in dark basic pro.

It would be easier to do then make and load hundreds of sprites.

The author of this post has marked a post as an answer.

Go to answer

blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 14th Sep 2020 05:15 Edited at: 14th Sep 2020 05:16
Game_Code_here
4
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 14th Sep 2020 09:07
There is no fixobjecttoscreen . So the object is glued to the screen. I'm setting up a inventory for the players and everything they pickup as game objects I would like to fix them to a screen position .
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 14th Sep 2020 11:20
FixSpriteToScreen ( iSpriteIndex, mode )
FixTextToScreen ( iTextIndex, mode )

fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 14th Sep 2020 19:06
This post has been marked by the post author as the answer.
If you are talking about 3D which it seems you are since you're asking about objects (not sprites or text) then there's no such thing as the 'screen'.
What you think of as the screen in 2D is the camera view in 3D. So I refer you to Blink0K's post and try searching for something that would fix objects and cameras together.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 14th Sep 2020 19:42 Edited at: 14th Sep 2020 19:47
if you really want FixObjectToScreen() functionality, i think you'll have to create an object, fix the camera to that cam object, then FixObjectToObject() whatever objects you want to fix to the "screen" or Camera:

IE, as scraggle suggests, something like:


you'll probably find it difficult to decide where to Fix the Object in 3d space in relation to the camera, tho. but, it can be done.

and, as scraggle suggests, it's probably more accurate to describe it as Fix3DObjectToCam() functionality.

i hope that helps
[My Itch.io Home] [#LowRezJamAGK2020]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=AGK] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[Google Forum Search]
Game_Code_here
4
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 14th Sep 2020 22:43
Thanks for the help Guys, Now that my question is answered I will stick with pasting sprites to the screen.

Not everything is so easy so I have to keep what can be simple as simple.

Login to post a reply

Server time is: 2024-11-21 23:37:07
Your offset time is: 2024-11-21 23:37:07