Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 16,302 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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 | 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