Author Topic: Need help setting up a slider  (Read 3253 times)

I'd recommend the use of buttons instead of sliders.  You could have one for clockwise rotation and one for counter-clockwise rotation.  That way, you could simply press one and continue rotating.

I'd recommend the use of buttons instead of sliders.  You could have one for clockwise rotation and one for counter-clockwise rotation.  That way, you could simply press one and continue rotating.
i just thought of that, and noticed it was easyer.

Yeah, just setup a rotate method.

Code: [Select]
function processRotateBtnPress(%val,%direction)
{
     if(%val)
     {
          beginRotation(%direction);
     }
     else
     {
          endRotation();
     }
}

Something like that would let you continue rotations for as long as you hold the button.

Now, if you wanted to toggle rotation, you could use something like this:

Code: [Select]
$rotationtoggle = 0;

function processRotateBtnPress(%val,%direction)
{
     if(%val)
     {
          if($rotationtoggle)
          {
               $rotationtoggle = 0;
               endRotation();
          }
          else
          {
               $rotationtoggle = 1;
               beginRotation(%direction);
          }
     }
}

Now, in both the examples above, %direction would be for counter-clockwise or clockwise.  So, for your clockwise button, you could have processRotateBtnPress(1); and for counter-clockwise, you could have processRotateBtnPress(-1);.
« Last Edit: October 31, 2007, 03:46:03 PM by Trader »

hmm kk i understand that, but how do i hook it up to the playerviewgui object?

That I'm not sure of.  I've never really messed with viewing objects inside of a GUI.  Check with Space Guy.

That I'm not sure of.  I've never really messed with viewing objects inside of a GUI.  Check with Space Guy.
well all it is is changing the number of a variable in a gui...

Ha, if you are so certain of how to do it, why did you ask?  One number from the GUI does not correspond to the rotation of the object.

Ha, if you are so certain of how to do it, why did you ask?  One number from the GUI does not correspond to the rotation of the object.
its not a 3D object though....
a variable on a gui object controls the rotation, but i dont know how to set it up..i only know how it works xD

I'm fairly certain it is a 3D object.  Check the avatar options GUI.  You're able to rotate the minifig with your mouse, and the minifig is walking.  Seems to me like it is 3D.

 :cookieMonster:

I'm fairly certain it is a 3D object.  Check the avatar options GUI.  You're able to rotate the minifig with your mouse, and the minifig is walking.  Seems to me like it is 3D.

 :cookieMonster:
That is ObjectView
im talking about PLAYERVIEW
like in the screenshot =/

You're wanting to implement something like the rear view mirror?

Code: [Select]
new GameTSCtrl(playerView)
{
profile = "GuiDefaultProfile";
horizSizing = "center";
vertSizing = "bottom";
position = "0 0";
extent = "8 2";
minExtent = "8 2";
visible = "1";
cameraZRot = "0";
forceFOV = "100";
};

Then just increase or decrease your cameraZRot.  Remember, it rotates in a circle.  So once you get to 0, the next value down would be 359.

You're wanting to implement something like the rear view mirror?

Code: [Select]
new GameTSCtrl(playerView)
{
profile = "GuiDefaultProfile";
horizSizing = "center";
vertSizing = "bottom";
position = "0 0";
extent = "8 2";
minExtent = "8 2";
visible = "1";
cameraZRot = "0";
forceFOV = "100";
};

Then just increase or decrease your cameraZRot.  Remember, it rotates in a circle.  So once you get to 0, the next value down would be 359.
..NO!!! i already got it implanted onto a guy...i just want a button or something that changes its CameraZrot
>_<

Wow, you are dumb.

Button that rotates counter-clockwise:

Code: [Select]
command = "rotatePlayerView(-1);";
Button that rotates clockwise:

Code: [Select]
command = "rotatePlayerView(1);";
Rotate method:

Code: [Select]
function rotatePlayerView(%adjust)
{
     playerView.cameraZRot += %adjust;
}

Wow, you are dumb.

Button that rotates counter-clockwise:

Code: [Select]
command = "rotatePlayerView(-1);";
Button that rotates clockwise:

Code: [Select]
command = "rotatePlayerView(1);";
Rotate method:

Code: [Select]
function rotatePlayerView(%adjust)
{
     playerView.cameraZRot += %adjust;
}
well sorry but i dont ussaly do this kind of stuff >_<
sorry

Well, "shouting" at people that are trying to help you is not a good place to start.