Game Development Community

Gui .png overlay for ironsites

by Logan Strunk · in Torque Game Engine · 12/19/2006 (4:13 pm) · 2 replies

I want to make a .png overlay on my screen to simulate ironsites for my guns.

I created a "rifleiron.gui" using the gui editor.

I exec it where it needs to be. Now, when I re run the gui editor, its there.

then, in default.bind.cs I add

$IronRifleState = false;
function toggleIronRifle() {
if ($IronRifle == false) {
Canvas.setContent( IronRifle );
$IronRifle = true;
} else {
Canvas.setContent( PlayGui );
$IronRifle = false;
}

}


moveMap.bindCmd(mouse0, button1, "toggleIronRifle();" );

Now, when I press mouse button 1, it should toggle the rifle iron sites on.

I also added the movemap.bind in /client/config.cs

now, its not working, when I press the button.

Am I missing something? Am I going about this wrong?

Could someone PLEASE help me?

#1
12/19/2006 (4:59 pm)
Check out my zoom resource.
#2
12/19/2006 (6:23 pm)
Will do. I bet they are very similar. I appreciate it!