Author Topic: The zooming command and GUI object size changing.  (Read 967 times)

I'm planning making a togglable 'scope'.

How would I:

>Set a value to something.  "zewm = 1"?.
>Sen an object in the HUD to a certain size.
>Make function work so it does one action if a value equals 1 and a different action if it is 0?

Also, what is the command that makes the zoom control work?
« Last Edit: February 05, 2009, 10:04:31 PM by Quantum »

Anyone?  Don't be shy.

2.HUDOBJECTWEITSNAMEIS.extent = x y;
3.
function toggleScope(%v)
{
   if(%v)
   {
       //do stuff
   }
   else
   {
      //do stuff
   }
}
dunno zoom commands

Destiny, setting the extent variable directly only works if you restart the GUI.

object.resize(x,y,w,h);

Thanks.

Does anyone know the zoom command, though?

Package/parent toggleScope(%val)

function toggleScope(%v)
{
   if(%v == 1)
   {
       object.resize(x,y,w,h);
       Package/parent toggleScope(%1);  <??
       %v == 0;
   }
   else
   {
       object.resize(x,y,w,h);
       Package/parent toggleScope(%1)<??
       %v == 1;
   }
}


Would work(rough idea, of course)?

Test it, really, people these days.



I was just showing where it would be placed, it was just an outline.

One more question:
How would I change the crosshair's position without restarting the GUI?


object.resize(x,y,w,h); allows you to set a position and an extent for the object.