Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (Akow), 1,361 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
pane size and screen resolution #407090
09/06/12 08:52
09/06/12 08:52
Joined: Apr 2008
Posts: 245
GameScore Offline OP
Member
GameScore  Offline OP
Member

Joined: Apr 2008
Posts: 245
i understand how to stretch a bmap up to the actual screen size
if the bmap should have the screen size
like this
Code:
main_pan.scale_x = screen_size.x / bmap_width(main_tga);
 main_pan.scale_y = screen_size.y / bmap_height(main_tga);



but how can i adjust a panel with 600*600 ?

i mean the actual resolution is
1280*1024 and the bmap have 600*800
now i change the resolution and i want to adapt the bmap

Re: pane size and screen resolution [Re: GameScore] #407091
09/06/12 09:16
09/06/12 09:16
Joined: Feb 2010
Posts: 320
TANA/Madagascar
3dgs_snake Offline
Senior Member
3dgs_snake  Offline
Senior Member

Joined: Feb 2010
Posts: 320
TANA/Madagascar
Hi,

I don't understand what you want to achieve, but here a code you can try :

Code:
// Scale bmap
var sx = screen_size.x / bmap_width(main_tga);
var sy = screen_size.y / bmap_height(main_tga);
      
var scale = minv(sx, sy);
main_pan.scale_x = main_pan.scale_y = scale;
main_pan.pos_x = (screen_size.x - (bmap_width(main_tga) * scale)) * 0.5;


Best regards.

Re: pane size and screen resolution [Re: 3dgs_snake] #407133
09/07/12 07:17
09/07/12 07:17
Joined: Apr 2008
Posts: 245
GameScore Offline OP
Member
GameScore  Offline OP
Member

Joined: Apr 2008
Posts: 245
thanks for your answer,
but it not what i mean

i mean my actual screen resolution is 1280*1024
and i have in this solution a panel with 600*600
now i change the solution to 1024*768
and i want that the panel to adapt ( scale )
the panel

Re: pane size and screen resolution [Re: GameScore] #407135
09/07/12 07:30
09/07/12 07:30
Joined: Feb 2010
Posts: 320
TANA/Madagascar
3dgs_snake Offline
Senior Member
3dgs_snake  Offline
Senior Member

Joined: Feb 2010
Posts: 320
TANA/Madagascar
Hi,

I think you need to put the update in a while(1) and when last_resolution != current_resolution, you apply your changes.


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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