PDA

View Full Version : Fullscreen attribute for menus



guiismiti
29th November 2014, 16:01
Hi,

I created a menu for the airstrike (some have seen it in video).
In this menu, each dot is an element, and when players select it, the menu closes and the airstrike hits that position.

803

The problem with it is that the first and last two columns don't work. Nothing happens when I click it.

Then I tried to set the fullscreen attribute to the menu


fullScreen 1


Problem solved, but now there's another one. When I select an element, the menu no longer closes.

Here's part of my menudef (the rest of the menu is just the elements):


name "airstrike"
rect 0 0 640 480
fullScreen 1
focuscolor AIRSTRIKE_FOCUSED_COLOR
style WINDOW_STYLE_EMPTY
blurWorld 5.0
onEsc
{
close airstrike;
}

guiismiti
29th November 2014, 16:58
I'm messing around with the rect, looks like it's something to do with that

Tally
29th November 2014, 17:09
I'm messing around with the rect, looks like it's something to do with that

Always draw a boarder around your rectangle so you can see if it is positioned properly:


itemDef
{
style WINDOW_STYLE_SHADER
rect -10 128 360 340
origin ORIGIN_INFO_BOX1
background "gradient"
border 1
bordersize 1
bordercolor 1.000 0.647 0.290 1
visible 1
decoration
}

guiismiti
29th November 2014, 17:24
Looks like I solved it...



name "airstrike"
rect -83 0 1366 769
focuscolor AIRSTRIKE_FOCUSED_COLOR
style WINDOW_STYLE_EMPTY

onEsc
{
close airstrike;
}


1. -83 is the original position of the first column of elements - the first two columns had negative values;
2. I'm using 1366 instead of 640 - the position of the last two columns was higher than 640;
3. I transposed all elements in the menu by adding +83 to their position value (so the first column is now positioned in 0, and not -83).

Everything works, but...

804

editted: oh I think I get it now...

Tally
29th November 2014, 19:50
Looks like I solved it...



name "airstrike"
rect -83 0 1366 769
focuscolor AIRSTRIKE_FOCUSED_COLOR
style WINDOW_STYLE_EMPTY

onEsc
{
close airstrike;
}


1. -83 is the original position of the first column of elements - the first two columns had negative values;
2. I'm using 1366 instead of 640 - the position of the last two columns was higher than 640;
3. I transposed all elements in the menu by adding +83 to their position value (so the first column is now positioned in 0, and not -83).

Everything works, but...

804

editted: oh I think I get it now...

You cannot exceed the 640 width. It doesn't work. Since otherwise, the developers themselves would have used it. And they never did. You must stick with the 640 x 480 engine width.