generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: How do you make a TextLabel draggable in only the Y axis

Previous Thread :: Next Thread 
Zevios is not online. Zevios
Joined: 14 Sep 2013
Total Posts: 504
18 Jan 2017 10:33 AM
Help is thankful, thanks
Report Abuse
MightyDantheman is not online. MightyDantheman
Joined: 06 May 2011
Total Posts: 5108
18 Jan 2017 10:37 AM
Either loop the x-axis or set up a custom drag system.


~MightyDantheman~
Report Abuse
Zevios is not online. Zevios
Joined: 14 Sep 2013
Total Posts: 504
18 Jan 2017 10:38 AM
Wtf??
Report Abuse
MightyDantheman is not online. MightyDantheman
Joined: 06 May 2011
Total Posts: 5108
18 Jan 2017 10:39 AM
Hmm?


~MightyDantheman~
Report Abuse
Raildex is not online. Raildex
Joined: 06 Dec 2009
Total Posts: 934
18 Jan 2017 10:40 AM
just have it set its x position to the same spot anytime its position is changed
Report Abuse
Snowskateer is not online. Snowskateer
Joined: 06 Dec 2011
Total Posts: 4647
18 Jan 2017 10:50 AM
loop x axis, like the person already said
Report Abuse
Zevios is not online. Zevios
Joined: 14 Sep 2013
Total Posts: 504
18 Jan 2017 11:03 AM
Do I use the property: AnchorPoints?

looping the x axis makes 0 sense to me
Report Abuse
mybowls72 is not online. mybowls72
Joined: 05 Aug 2013
Total Posts: 2688
18 Jan 2017 11:07 AM
siggy username = ego.
Report Abuse
RobuxLife is not online. RobuxLife
Joined: 19 Sep 2012
Total Posts: 13336
18 Jan 2017 11:12 AM
Looping the X axis means your keeping the X property the same. So, if it's moved, keep it in the same position.


Report Abuse
RogueMage is not online. RogueMage
Joined: 28 Jan 2012
Total Posts: 1235
18 Jan 2017 11:16 AM
game:GetService("RunService").RenderStepped:Connect(function()
gui.DragBegin:Connect(function(originalPosition)
gui.Position.X.Scale = originalPosition.X.Scale
end)
end)
Report Abuse
OzzyFin is not online. OzzyFin
Joined: 07 Jun 2011
Total Posts: 3600
18 Jan 2017 11:17 AM
Scale is read-only
Report Abuse
Raildex is not online. Raildex
Joined: 06 Dec 2009
Total Posts: 934
18 Jan 2017 11:21 AM
game:GetService("RunService").RenderStepped:Connect(function()
gui.DragBegin:Connect(function(originalPosition)
gui.Position = UDim2.new(originalPosition.X.Scale,0,gui.Position.Y.Scale,0)
end)
end)
Report Abuse
RogueMage is not online. RogueMage
Joined: 28 Jan 2012
Total Posts: 1235
18 Jan 2017 11:21 AM
aaaaaaaaaaa


local xPositionScale = gui.Position.X.Scale
local xPositionOffset = gui.Position.X.Offset
local yPositionScale = gui.Position.Y.Scale
local yPositionOffset = gui.Position.Y.Offset

game:GetService("RunService").RenderStepped:Connect(function()
yPositionScale = gui.Position.Y.Scale
yPositionOffset = gui.Position.Y.Offset
gui.DragBegin:Connect(function()
gui.Position = UDim2.new(xPositionScale, xPositionOffset, yPositionScale, yPositionOffset)
end)
end)

-- don't even know if this will work i pulled it out of my butt
Report Abuse
Zevios is not online. Zevios
Joined: 14 Sep 2013
Total Posts: 504
18 Jan 2017 11:23 AM
gui = script.Parent

while true do
wait()
gui.Position = UDim2.new(0,31,0,120)
end



So Im not sure how to only stop the dragging in the X axis and the way I done it is very glitchy because when you drag, the gui keeps going back and forth.

Please help if you can, thanks
Report Abuse
RogueMage is not online. RogueMage
Joined: 28 Jan 2012
Total Posts: 1235
18 Jan 2017 11:24 AM
dont do a while true loop

that's stupid
Report Abuse
Zevios is not online. Zevios
Joined: 14 Sep 2013
Total Posts: 504
18 Jan 2017 11:25 AM
@Rogue thank you it worked!

Report Abuse
Zevios is not online. Zevios
Joined: 14 Sep 2013
Total Posts: 504
18 Jan 2017 11:25 AM
you're stupid
Report Abuse
RogueMage is not online. RogueMage
Joined: 28 Jan 2012
Total Posts: 1235
18 Jan 2017 11:26 AM
np my dude


i feel good now that i pulled code out of my ass yet it still worked


nice
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image