Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 01:28
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (kzhao, AndrewAMD, bigsmack), 824 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
One code to rule them all #395397
02/23/12 09:13
02/23/12 09:13
Joined: Feb 2012
Posts: 9
E
Enix Offline OP
Newbie
Enix  Offline OP
Newbie
E

Joined: Feb 2012
Posts: 9
Hi, I have a question.

I would like to give a choice of different resolutions in my game but I faced one problem.
If I write a code for some resolution eg. 1024x768, and a player choose some other resolution, my code won`t work any more cos many aspects like positions and distances will be distorted. Is there any solution in GS or I must write a whole script to handle this? Is there a way to make a code which will work regardless from chosen resolutions and what could be the simplest way?

I apologize if this has already been asked, I have not found it.

Last edited by Enix; 02/23/12 09:14.
Re: One code to rule them all [Re: Enix] #395405
02/23/12 10:56
02/23/12 10:56
Joined: Aug 2009
Posts: 1,438
Spain
painkiller Offline
Serious User
painkiller  Offline
Serious User

Joined: Aug 2009
Posts: 1,438
Spain
of course, you can align your elements to different corners of the screen. For example, this will put your panel always at 50 pixels from the screen bottom and 30 pixels from the right side.

Code:
PANEL *my_panel=
{
  ...
}

...

while(1)
{
   my_panel.pos_x=screen_size.x-my_panel.size_x-30;
   my_panel.pos_y=screen_size.y-my_panel.size_y-50;

wait(1);
}




3D Gamestudio A8 Pro
AMD FX 8350 4.00 Ghz
16GB RAM
Gigabyte GeForce GTX 960 4GB
Re: One code to rule them all [Re: Enix] #395406
02/23/12 11:00
02/23/12 11:00
Joined: Nov 2011
Posts: 274
de
lemming Offline
Member
lemming  Offline
Member

Joined: Nov 2011
Posts: 274
de
You talk of panels, don't you? You can try scaling them to fit the resolution or use a script to move them around relative to the resolution. Or both of it.

edit:// painkiller was faster, I meant a script like his.

Last edited by lemming; 02/23/12 11:01.
Re: One code to rule them all [Re: lemming] #395416
02/23/12 12:31
02/23/12 12:31
Joined: Feb 2012
Posts: 9
E
Enix Offline OP
Newbie
Enix  Offline OP
Newbie
E

Joined: Feb 2012
Posts: 9
Yes, that`s it. I thought maybe there was some pre-made script which unites pixels and quants in a whole what would be the most elegant solution to control coordinates. But this will do also. Thanks.

Can I ask one more thing:

It seems there is a lost workshop in Online Tutorial. You see, at the end of workshop21 there is a link "Next: Walking, collision, events", but it leads only to workshop22 - Local Variables.

Whether the "Lost Chapter" can be found somewhere?

I could use some more informations about the topics, especially collisions.

Re: One code to rule them all [Re: Enix] #395493
02/23/12 23:39
02/23/12 23:39
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline
Serious User
Reconnoiter  Offline
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Collisions is explained extensive in the gamestudio manual I think (you can find the manual in the same folder as SED.exe, WED.exe etc.).

Re: One code to rule them all [Re: Reconnoiter] #395496
02/24/12 00:15
02/24/12 00:15
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline
Serious User
darkinferno  Offline
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
you could also place panels using percentages, for example:

panel.pos_x= screen_size.x * 0.95

Re: One code to rule them all [Re: darkinferno] #395753
02/27/12 12:34
02/27/12 12:34
Joined: Feb 2012
Posts: 3
K
kuro Offline
Guest
kuro  Offline
Guest
K

Joined: Feb 2012
Posts: 3
Ok yes I like


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1