0 registered members (),
806
guests, and 3
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
[Solved]start screen bmap resizeable?
#347621
11/17/10 03:52
11/17/10 03:52
|
Joined: Nov 2008
Posts: 43
Ice2642
OP
Newbie
|
OP
Newbie
Joined: Nov 2008
Posts: 43
|
Hello,
I would like to know if it is possible resize a bmap to be used in the start screen to it change to the same size of the screen resolution ?
for example, I have a start screen bmap with 1600x900. if the user set the resolution of the game for 640x480. I want the bmap to be resized to 640x480 too. or any othe size set up in the game preferences by the user.
how can I do this, or if it is not possible, how change the bmap to the game can fit all possibles screen resolution seted by the user to run the game with a right size bmap start screen ?
Thank you in advance.
BR
Last edited by Ice2642; 11/17/10 20:33.
A8 PRO 8.47.1
|
|
|
Re: start screen bmap resizeable?
[Re: Ice2642]
#347626
11/17/10 08:23
11/17/10 08:23
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Firstly, welcome aboard...
To similate a re-sizable bmap you are best off, in my opinion, to use a panel.
First, define yourself a "splash screen" using a panel, and assign your bmap to it. DONT assign the panel an x_size or y_size, and it will inherit the size of the bmap. Then whenever the screen resolution is changed, or when making the panel visible, you need to recalculate the panels scale_x and scale_y values according to the required result...
EG : (assumes panel is named 'splash') splash.pos_x = splash.pos_y = 0; splash.scale_x = screen_size.x / splash.bmap.width; splash.scale_y = screen_size.y / splash.bmap.height;
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: start screen bmap resizeable?
[Re: EvilSOB]
#347631
11/17/10 10:12
11/17/10 10:12
|
Joined: Nov 2008
Posts: 43
Ice2642
OP
Newbie
|
OP
Newbie
Joined: Nov 2008
Posts: 43
|
Thank you for the wellcome and answer. I will try it, and apears it will work. good idea thank you. BR
A8 PRO 8.47.1
|
|
|
Re: start screen bmap resizeable?
[Re: Ice2642]
#347668
11/17/10 19:00
11/17/10 19:00
|
Joined: Nov 2008
Posts: 43
Ice2642
OP
Newbie
|
OP
Newbie
Joined: Nov 2008
Posts: 43
|
Thank you very much. I made a function splash_startup to control the splash size
function painel_startup()
{
while(1)
{
splash.pos_x = splash.pos_y = 0;
splash.scale_x = screen_size.x / splash.bmap.width;
splash.scale_y = screen_size.y / splash.bmap.height;
wait(1);
}
}
Work 100% Uploaded with ImageShack.usBest Regards,
A8 PRO 8.47.1
|
|
|
Re: start screen bmap resizeable?
[Re: Ice2642]
#347670
11/17/10 19:10
11/17/10 19:10
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Good stuff. Well done. And Im glad to help... One suggestion though, to avoid 'wasting' horsepower with un-necessary tasks, I would change your code to this...
function painel_startup()
{
while(1)
{
if(is(splash, SHOW))
{
splash.pos_x = splash.pos_y = 0;
splash.scale_x = screen_size.x / splash.bmap.width;
splash.scale_y = screen_size.y / splash.bmap.height;
}
wait(1);
}
}
That way it only actively re-sizes the splash if its actually visible... There are other optimizations you could do, but this will get rid of the worst of it... [DEIT] Do I see a hand-icon ripped from Dungeon Keeper in the screen-shots? Or is it just a good copy...
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: start screen bmap resizeable?
[Re: Lukas]
#347675
11/17/10 19:42
11/17/10 19:42
|
Joined: Nov 2008
Posts: 43
Ice2642
OP
Newbie
|
OP
Newbie
Joined: Nov 2008
Posts: 43
|
Ok, I made a var KlX = 9; in the code start. I change the function to;
function painel_startup()
{
while(KlX==9)
{
splash.pos_x = splash.pos_y = 0;
splash.scale_x = screen_size.x / splash.bmap.width;
splash.scale_y = screen_size.y / splash.bmap.height;
wait(1);
}
}
In this way, just until KlX is = 9 the while will work. When the game start the KlX change to 0, no more needed the scale of intro panel. This is a good solution ? Thank you for the help. BR
A8 PRO 8.47.1
|
|
|
Re: start screen bmap resizeable?
[Re: Lukas]
#347680
11/17/10 20:06
11/17/10 20:06
|
Joined: Nov 2008
Posts: 43
Ice2642
OP
Newbie
|
OP
Newbie
Joined: Nov 2008
Posts: 43
|
Ok, Thank you for the help. I will get a look in the VOID solution, but, maybe the resize is needed if the player change thesettings in-game and return to start screen. edit** I change to;
void painel_startup()
{
while(1)
{
splash.pos_x = splash.pos_y = 0;
splash.scale_x = screen_size.x / splash.bmap.width;
splash.scale_y = screen_size.y / splash.bmap.height;
wait(5);
}
}
Using the void now instead the function and chang the wait to 5 to get less resourses. This is ok now ? Thank you for the help. BR
Last edited by Ice2642; 11/17/10 20:12.
A8 PRO 8.47.1
|
|
|
|