Panel-scale

Posted By: WeTwoPlays

Panel-scale - 11/24/12 15:00

Wie kann ich ein Panel erzeugen, das das gesamte Fenster abdeckt?
Wenn ich die Bmap in einer Auflösung von 1280*720 habe? Es ist bei anderen immer rechts und unten ein Spalt frei.
Posted By: Uhrwerk

Re: Panel-scale - 11/24/12 15:05

Du musst die pos_x, pos_y und die scale_x und scale_y member des Panels entsprechend mitskalieren.
Posted By: WeTwoPlays

Re: Panel-scale - 11/24/12 15:11

also scale_x = screen_size_x, danke
Posted By: Uhrwerk

Re: Panel-scale - 11/24/12 15:17

Das scheint mir etwas übertrieben... ^^

Aber mit panel.scale_x = screen_size.x / panel.size_x könntest Du es mal versuchen.
Posted By: Kartoffel

Re: Panel-scale - 11/24/12 15:33

ja, uhrwerk hat recht wink
scale_x und scale_y ist der skalierungsfaktor, nicht die zielgröße in pixeln.
Posted By: Yashas

Re: Panel-scale - 11/24/12 15:46

Hi,
Code:
int x_pixels = screen_size.x;


This will hold the horizontal size of the PANEL you want.

Code:
int y_pixels = screen_size.y;


This will hold the vertical size of PANEL you want.

Code:
int scale_y_value = y_pixels / PANEL.size_y /* Current PANEL Size */;
int scale_x_value = x_pixels / PANEL.size_x /* Current PANEL Size */;



The formula to find how much you need to scale
= [WHAT SIZE YOU WANT] / [CURRENT SIZE]
This will give by what percentage the PANEL must be scaled to fit to your size.

This will stretch PANEL to cover the whole screen.
Code:
PANEL * pan =
{
    bmap = somebackground;
}
function main ()
{
    pan.scale_x = screen_size.x / pan.size_x;
    pan.scale_y = screen_size.y / pan.size_y;
    set(pan,SHOW);
}



Best of Luck laugh
Posted By: WeTwoPlays

Re: Panel-scale - 11/24/12 16:24

danke O.o
Posted By: Yashas

Re: Panel-scale - 11/24/12 16:49

http://translation.babylon.com/german/to-english/ - Translating grin
Wlcm laugh
© 2024 lite-C Forums