Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   GuiSliderCtrl (https://forums.graalonline.com/forums/showthread.php?t=64052)

projectigi 02-12-2006 01:07 AM

GuiSliderCtrl
 
Hi,

I made a Slider Ctrl
NPC Code:

//#CLIENTSIDE
function onWeaponfired(){
new GuiWindowCtrl(MainTestingHUD){
x=200;y=200;width=400;height=400;
text="Slider Test";
profile="GuiBlueWindowProfile";
canclose=true;
canresize=false;
destroyonhide=true;
new GuiTextCtrl(MainTestingHUD_Text01){
position="10 160";
text="Testing...";
profile="GuiBlueTextProfile";
}
new GuiSliderCtrl(MainTestingHUD_Slider01){
profile="GuiBlueSliderProfile";
position="10 180";
extent="200 40";
range="0 5";
ticks=1;
value=1;
}
}
}



but my slider goes about 0.847 and so on, whats wrong?
i thought ticks=1; would tell it to make 0,1,2,3,4,5?

Skyld 02-12-2006 01:21 AM

ticks is an option to display visual ticks on the bar, isn't it?

Rick 02-12-2006 02:48 AM

As I said on IRC, try making ticks to be 10 or 11, not 1.

projectigi 02-12-2006 10:58 AM

ticks=10; or ticks=11; changes nothing =/

how to make my slider go over .5 or full numbers only?
like
0 0.5 1 1.5 ...
or
0 1 2 3...

ApothiX 02-12-2006 11:36 AM

Quote:

Originally Posted by projectigi
ticks=10; or ticks=11; changes nothing =/

how to make my slider go over .5 or full numbers only?
like
0 0.5 1 1.5 ...
or
0 1 2 3...

value*10 ?

projectigi 02-12-2006 11:57 AM

uhm? tried ticks=value*10;
and value=value*10;

yeah i replaced value with the actually value but it dont changes anything :(

xXziroXx 02-12-2006 04:32 PM

try:

value = "1";


out of ideas..

ApothiX 02-13-2006 03:44 PM

Quote:

Originally Posted by projectigi
uhm? tried ticks=value*10;
and value=value*10;

yeah i replaced value with the actually value but it dont changes anything :(

I meant as a simple hack if there was no way to actually change it. You would do that when you want to reference the value.

Admins 02-25-2006 08:04 PM

Currently the "ticks" are only for display, it will only snap to the closest tick if you press the Shift-key while moving the slider. Eventually we could add an option to always snap to the closest tick ?

ApothiX 02-27-2006 03:30 PM

Quote:

Originally Posted by Stefan
Currently the "ticks" are only for display, it will only snap to the closest tick if you press the Shift-key while moving the slider. Eventually we could add an option to always snap to the closest tick ?

could make it fairly easily with something like:

PHP Code:

function SliderCtrl.onAction() {
  
value int(value);


?


All times are GMT +2. The time now is 03:59 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.