BogyMac
|
  |
| Joined: 04 Nov 2011 |
| Total Posts: 823 |
|
|
| 05 Mar 2014 10:14 PM |
I'm trying to create a TextButton that, when clicked, acts as a slider that can only move in the Y direction. I am unsure how to do this, but here is my script so far:
dragging = false
script.Parent.DragBegin:connect(function(pos) dragging = true while dragging == true do if script.Parent.Position.X.Offset < 9 or script.Parent.Position.X.Offset > 9 then --??? end wait() end end)
script.Parent.DragStopped:connect(function(pos) dragging = false end)
Thanks for any help, -Bogy |
|
|
| Report Abuse |
|
|
BogyMac
|
  |
| Joined: 04 Nov 2011 |
| Total Posts: 823 |
|
| |
|
BogyMac
|
  |
| Joined: 04 Nov 2011 |
| Total Posts: 823 |
|
|
| 05 Mar 2014 10:30 PM |
| ppl, y u no post helpful reply? :P |
|
|
| Report Abuse |
|
|
dave2011
|
  |
| Joined: 02 Oct 2010 |
| Total Posts: 10581 |
|
|
| 05 Mar 2014 10:34 PM |
| I culd but dis luks liek it bel0ngs 1n an0ther f0rum |
|
|
| Report Abuse |
|
|
BogyMac
|
  |
| Joined: 04 Nov 2011 |
| Total Posts: 823 |
|
|
| 05 Mar 2014 10:36 PM |
In case you didn't know, this is the correct forum. I am not asking for an entire script, I am just asking how you would go about creating a slider.
So before you try to be sarcastic and quote me on things I said, make sure it makes sense first.
-Bogy |
|
|
| Report Abuse |
|
|
powertool
|
  |
| Joined: 01 Feb 2008 |
| Total Posts: 3771 |
|
|
| 05 Mar 2014 10:37 PM |
| This belongs here, alright. He's asking how he'd script a textbutton to be moveable in only one direction. I'd suggest ripping apart a script that does that (eg the terrain plugin or somethin), then seeing how they do it. |
|
|
| Report Abuse |
|
|
dave2011
|
  |
| Joined: 02 Oct 2010 |
| Total Posts: 10581 |
|
|
| 05 Mar 2014 10:41 PM |
"Don't ask others to debug your broken code without giving a hint what sort of problem you are having. Posting a few hundred lines of code, saying "it doesn't work", will get you ignored. Posting a dozen lines of code, saying "after line 7 I was expecting to see (something), but (something else) happened instead" is much more likely to get you a reply."
this says the forum is for debugging scripts not help creating them.
|
|
|
| Report Abuse |
|
|
|
| 05 Mar 2014 10:43 PM |
This belongs here.
@OP Do you want a SCROLL bar or a TICKER bar? |
|
|
| Report Abuse |
|
|
BogyMac
|
  |
| Joined: 04 Nov 2011 |
| Total Posts: 823 |
|
|
| 05 Mar 2014 10:46 PM |
A Scrolling bar that only moves in the Y direction that cannot be moved beyond a certain limit.
Example of this is in Windows/Other OS if you have a list of items in a folder too large to show a scroll bar will appear that allows you to move the list up and down. |
|
|
| Report Abuse |
|
|
|
| 05 Mar 2014 10:47 PM |
Just making sure, as a slider is something that is completely different from a scroll bar.
If you wait a bit, I'm building a Scrollbar class so you only have to connect a Scroll event. You can see the source, too, so you can look at the raw events that I used, too. |
|
|
| Report Abuse |
|
|
|
| 05 Mar 2014 11:30 PM |
| I have not used it (yet), so I do not know if it works well, but there is a model by Ananimus that seems like it has what you are looking for: www.roblox.com/SlideBar-Control-item?id=33312050 |
|
|
| Report Abuse |
|
|
drahsid5
|
  |
| Joined: 13 May 2011 |
| Total Posts: 3937 |
|
|
| 05 Mar 2014 11:39 PM |
something like
mouse = game.Players.LocalPlayer:GetMouse() TextBoxx = script.Parent Val = script.Parent.Parent function onClick() local MinY = 0 local MaxY = 0.5 TextBox.Position.y = mouse.hit.p if TextBox.Position.y < MinY then TextBox.Position.y = MinY elseif TextBox.Position.y > MaxY then TextBox.Position.y = MaxY end Val = TextBox.Position.y*10
mouse.Mousebutton1Click:connect(onClick) |
|
|
| Report Abuse |
|
|
|
| 06 Mar 2014 02:32 AM |
| http://www.roblox.com/RbxScrollbar-Library-item?id=148646845 |
|
|
| Report Abuse |
|
|