Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-12-2006, 01:07 AM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
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?
Reply With Quote
  #2  
Old 02-12-2006, 01:21 AM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
ticks is an option to display visual ticks on the bar, isn't it?
__________________
Skyld
Reply With Quote
  #3  
Old 02-12-2006, 02:48 AM
Rick Rick is offline
PipBoy Extraordinaire!
Rick's Avatar
Join Date: Jul 2004
Location: Long Beach, California.
Posts: 831
Rick is on a distinguished road
As I said on IRC, try making ticks to be 10 or 11, not 1.
Reply With Quote
  #4  
Old 02-12-2006, 10:58 AM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
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...
Reply With Quote
  #5  
Old 02-12-2006, 11:36 AM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
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 ?
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #6  
Old 02-12-2006, 11:57 AM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
uhm? tried ticks=value*10;
and value=value*10;

yeah i replaced value with the actually value but it dont changes anything
Reply With Quote
  #7  
Old 02-12-2006, 04:32 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
try:

value = "1";


out of ideas..
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #8  
Old 02-13-2006, 03:44 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
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.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #9  
Old 02-25-2006, 08:04 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
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 ?
Reply With Quote
  #10  
Old 02-27-2006, 03:30 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
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);

?
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:12 PM.


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