Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I go about controllable GUIs?

Asked by 4 years ago

While this isn't a direct coding error, I'm wondering how I would go about scripting controllable GUIs (By that I mean, a little blob one could move around on screen). This is for my little project of building a retro arcade machine inside of ROBLOX. I have a reasonable amount of experience/knowledge when it comes to Lua programming. Thanks in advance :)

0
you can just do gui.Draggable = true, and this is really vague. Dan_PanMan 227 — 4y
0
The Draggable Property has been deprecated. Diamond9195 45 — 4y

2 answers

Log in to vote
0
Answered by 4 years ago

You can place this inside s local script inside the Gui Object you wish to move:

01local UserInputService = game:GetService("UserInputService")
02 
03local gui = script.Parent
04 
05local dragging
06local dragInput
07local dragStart
08local startPos
09 
10local function update(input)
11    local delta = input.Position - dragStart
12    gui.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
13end
14 
15gui.InputBegan:Connect(function(input)
View all 39 lines...

Too much to explain to be honest.

Hope this helps. :)

0
awesome, thanks a lot :) whosbossme 27 — 4y
Ad
Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

just listen for input events.. like maybe if a key is pressed or a finger is slid on the screen, you move the GUI in a particular direction, and things like that..

Answer this question