Author Topic: How would I create a gui that makes a black overlay on the screen  (Read 576 times)

Basically /title. I need to know how to do stuff like this because all I know how to do in GUI's are window GUI's and buttons and stoof.

you can use the gui swatch control and change the color in the box that says colors: 0 0 0 0

in order its r g b a

also for the size use the box that says extent. i think the size to cover the screen is 800 600
« Last Edit: January 06, 2013, 12:29:38 AM by Dante77 »

you can use the gui swatch control and change the color in the box that says colors: 0 0 0 0

in order its r g b a

also for the size use the box that says extent. i think the size to cover the screen is 800 600


No, you are wrong.

To make an overlay, i'd first make it in photoshop or gimp. Then use the gui bitmap ctrl to place it. Now to set it to the screen you'd use the function getRes(); and do some simple math for the extent.

He's not wrong. He just said a black overlay, not some kind of fantastic image stretched across his screen. If he just wanted to darken the screen while his GUI was up then a swatch would be the proper solution.

Actually, he's wrong about the extent part. You'll want to use either canvas.getExtent() or getRes(), but I perfer canvas.getExtent() because it requires less (zero) manipulation.
« Last Edit: January 06, 2013, 05:18:30 AM by !Trinick »

If you use a guiSwatchCtrl for the GUI itself, you don't need to resize anything.

Code: [Select]
new guiSwatchCtrl( blackOverlayGUI )
{
position = "0 0";
extent = "0 0";

visible = true;
mColor = "0 0 0 255";
};

Together with:

canvas.pushDialog( blackOverlayGUI );
canvas.popDialog( blackOverlayGUI );


This would automatically cause your overlay to fill the entire screen.

you can use the gui swatch control and change the color in the box that says colors: 0 0 0 0

Er, no, it'd be 0 0 0 255.
If the translucency is 0, it'd be invisible.

also for the size use the box that says extent. i think the size to cover the screen is 800 600

Depends on the game resolution.
« Last Edit: January 06, 2013, 05:21:13 AM by Port »