Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 642 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Resizing panels problem #453919
08/19/15 00:37
08/19/15 00:37
Joined: May 2014
Posts: 179
The lit part of the Truth
C
CyberGhost Offline OP
Member
CyberGhost  Offline OP
Member
C

Joined: May 2014
Posts: 179
The lit part of the Truth
These panels are intended to cover the whole screen/engine window. The resolution of the screen can be changed in the settings, so, I put these two lines for every panel of this kind in a while loop:-

Code:
panel.size_x = screen_size.x;
panel.size_y = screen_size.y;



But the panel is not resized and it keeps its original size ...


Nothing to say ....
Re: Resizing panels problem [Re: CyberGhost] #453931
08/19/15 10:02
08/19/15 10:02
Joined: Dec 2009
Posts: 82
D
Denn15 Offline
Junior Member
Denn15  Offline
Junior Member
D

Joined: Dec 2009
Posts: 82
as far as i know, to resize panels you should set its scale_x and scale_y

for your purpose this should work
Code:
panel.scale_x = screen_size.x / panel.size_x; 
panel.scale_y = screen_size.y / panel.size_y;



im not entirely sure if the size_x and size_y components change value after the panel is scaled, but if it is, then, if your panel is 64 by 64 pixels, just do it like this instead

Code:
panel.scale_x = screen_size.x / 64; 
panel.scale_y = screen_size.y / 64;


Re: Resizing panels problem [Re: Denn15] #453939
08/19/15 12:46
08/19/15 12:46
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline
Serious User
Reconnoiter  Offline
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Use size_x/size_y if you want your panel bmap to be tiled over the screen or part of the screen. This keeps buttons at the same size. This is usefull for example for a fullscreen inventory screen or other fullscreen menus. Or for some 2d games that use mostly panels.

Use scale_x/scale_y if you want to resize your panel. It scales the bmap, size and buttons etc. This is for example usefull for loading screens or other panels with only a bmap/image.

Last edited by Reconnoiter; 08/19/15 12:50.
Re: Resizing panels problem [Re: Reconnoiter] #453940
08/19/15 12:58
08/19/15 12:58
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline
Expert
Kartoffel  Offline
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
note that you can only use the tiling that Reconnoiter mentioned if the texture size is a power of two.

Also I recommend to apply the FILTER-flag to the panel which enables linear interpolation and prevents the pixelated look of unfiltered texture scaling.


POTATO-MAN saves the day! - Random
Re: Resizing panels problem [Re: Kartoffel] #453942
08/19/15 13:56
08/19/15 13:56
Joined: May 2014
Posts: 179
The lit part of the Truth
C
CyberGhost Offline OP
Member
CyberGhost  Offline OP
Member
C

Joined: May 2014
Posts: 179
The lit part of the Truth
Ok, I used scale_x/y and FILTER flag like Kartoffel said and it worked ,but there is some line on the right side/bottom of the screen that the panel doesn't cover, is this normal? I have to decrease one or two pixels from the size of the panel when I use the 2 instructions for resizing (f.i. if the size of the image file is 1000x500 ,I have to change it in the script to be 998x498) and it works ,but should I do this every time or there is a permanent solution?


Nothing to say ....

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