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 / HUD Plains

Author
Message
AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 1st Jan 2009 17:52 Edited at: 1st Jan 2009 17:52
Hi,
I am trying to make some code that will create a plain and will be in the same position on any screen resolution. So I found this code for DBP

http://forum.thegamecreators.com/?m=forum_view&t=42508&b=6

And rewrote the code for the DarkGDK, however it does not work?



This should make a plain the size of the screen, but it doesnt. Any idea why?

Thanks,
Alex

Cloggy
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 1st Jan 2009 21:36
Alex,

Here is some code I think should work. It's an advance from the original concept as that code need some work.

firstly you need to make the hud object seperately.



I have created a function to position the hud plain.



Then in you main loop just call the position code to ensure the plain remains lined up correctly.



Hope that makes sense.

AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 2nd Jan 2009 01:53
Thanks a lot!

What was I doing wrong though? Something with zdist calculation?

Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 2nd Jan 2009 08:19
Why can't you use sprites?
AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 2nd Jan 2009 08:44 Edited at: 2nd Jan 2009 08:44
I can use pick object, which is nice means I don't have to check against the mouse x and y > or < a certain amount for buttons. Also you can add more effects on 3D objects.

AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 11th Jan 2009 18:25 Edited at: 11th Jan 2009 18:27
I have got a problem:

I am designing my game menu, If I use this function and try my game on different screen resolutions it will not work, unless the images are resized for each resolution.

However if I just make a plain and point it at the camera and move it in front of the camera it will work on any screen resolution. But the image looks pixilated when it is done this way, even on the resolution it was designed for. Is there anyway to get it to be high quality and work on any resolution?

Thanks,
Alex

AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 11th Jan 2009 23:05 Edited at: 11th Jan 2009 23:11
Quote: "I can use pick object, which is nice means I don't have to check against the mouse x and y > or < a certain amount for buttons. Also you can add more effects on 3D objects."


I'm not sure if this will effect you--it really depends on the number of GUI elements you use--but checking if a mouse is over a specific part of the screen is appr. 300 times faster than using 'Pick Object'. Both methods are fairly fast, however if you want to optimize your game as much as you possibly can you may consider finding a different way to check if the mouse is over a GUI element.

AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 11th Jan 2009 23:12 Edited at: 11th Jan 2009 23:16
Thanks but the menu will be fairly fast even when I am using pick object as there's not much too the my menu.

Any idea how I could get it to work on all screen resolutions?

Login to post a reply

Server time is: 2024-11-25 11:20:16
Your offset time is: 2024-11-25 11:20:16