Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, Grant, Neb), 908 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 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