panel position

Posted By: JazzDude

panel position - 03/08/10 17:41

I would like a panel to always be 80 above the bottom of the full screen or the window regardless of the screen resolution.

This doesn't work:

pos_y = (screen_size.y - 80);
or
pos_y = (screen_size.y)- 80;

And this doesn't work:

var desktopHeight;
desktopHeight = sys_metrics(1); (in the main function)

pos_y = (desktopHeight -80);
or
pos_y = (desktopHeight)-80;

Any suggestions would be appreciated. Thanks.
Posted By: Superku

Re: panel position - 03/08/10 17:53

function keep_a_distance_startup() {
while(1) {
mypanel.pos_y = screen_size.y-80-mypanel.size_y;
wait(1);
}
}

Should work?
Posted By: DJBMASTER

Re: panel position - 03/08/10 18:42

Maybe it is better using the on_d3d_reset event?
Posted By: JazzDude

Re: panel position - 03/08/10 19:39

Thanks Superku, that is exactly what I was trying to code. I might have figured it out in a few days. smile
Posted By: Superku

Re: panel position - 03/08/10 20:02

Your welcome but DJBMASTER is right, you should do it his way.
Posted By: JazzDude

Re: panel position - 03/11/10 00:59

The manual didn't help me on that.

Only this sentence registered, grin LOL!:
Quote:
If you have no idea what I'm talking about, you probably won't need on_d3d_lost or on_d3d_reset

Posted By: DJBMASTER

Re: panel position - 03/11/10 01:16

Here you go...
Code:
function SetPanelPosition()
{
mypanel.pos_y = screen_size.y-80-mypanel.size_y;
}

function main()
{
on_d3d_reset = SetPanelPosition;
}


Now every time you change resolution, the panel will auto position.
Posted By: MMike

Re: panel position - 03/14/10 23:31

Originally Posted By: JazzDude
I would like a panel to always be 80 above the bottom of the full screen or the window regardless of the screen resolution.

This doesn't work:

pos_y = (screen_size.y - 80);
or
pos_y = (screen_size.y)- 80;

And this doesn't work:

pos_y = (desktopHeight -80);
or
pos_y = (desktopHeight)-80;

Any suggestions would be appreciated. Thanks.



Oh my god you made my day...
(desktopHeight)-80; its exactly the same of desktopHeight-80;
© 2024 lite-C Forums