【问题标题】:How to get this in my GUI?如何在我的 GUI 中得到这个?
【发布时间】:2018-01-05 20:10:24
【问题描述】:

感谢您查看我的问题,希望您能给我带来我正在寻找的遮阳篷。我尝试了很多不同的方法。也许我只是忽略了它。我是 gui 制作等方面的新手。感谢您提前提供的任何意见

这适用于使用 LUA 运行的游戏 Roblox

我的问题是... 好的,所以我想要这个基本的文本按钮来关闭 GUI 的打开状态。 我无法弄清楚 lmfao 也许有人可以帮助我吗? 我想我必须制作一个新框架并将其放在我想要的位置并将文本按钮放在它上面但不。我尝试了更多方法,但都没有奏效。

-- Objects
local VanScreenGui = Instance.new("ScreenGui")
local OpenFrame = Instance.new("Frame")
local OpenTextButton = Instance.new("TextButton")
local VanGui = Instance.new("Frame")
local VanTextButton = Instance.new("TextButton")
local VanTextBox = Instance.new("TextBox")
local VanGuiCloser = Instance.new("TextButton")
local VanGuiCloserFrame = Instance.new("Frame")

-- Properties
VanScreenGui.Name = "VanScreenGui"
VanScreenGui.Parent = game.CoreGui
--
OpenFrame.Name = "OpenFrame"
OpenFrame.Parent = VanScreenGui
OpenFrame.BackgroundColor3 = Color3.new(1, 1, 1)
OpenFrame.Draggable = true
OpenFrame.Position = UDim2.new(0, 27, 0, 448)
OpenFrame.Size = UDim2.new(0, 76, 0, 29)
OpenFrame.Style = Enum.FrameStyle.DropShadow

OpenTextButton.Name = "Open.TextButton"
OpenTextButton.Parent = OpenFrame
OpenTextButton.BackgroundColor3 = Color3.new(1, 1, 1)
OpenTextButton.Position = UDim2.new(0, 6, 0, 0)
OpenTextButton.Size = UDim2.new(0, 50, 0, 15)
OpenTextButton.Style = Enum.ButtonStyle.RobloxRoundButton
OpenTextButton.Font = Enum.Font.SourceSans
OpenTextButton.FontSize = Enum.FontSize.Size14
OpenTextButton.Text = "OPEN"
OpenTextButton.TextSize = 14

VanGui.Name = "VanGui"
VanGui.Parent = VanScreenGui
VanGui.BackgroundColor3 = Color3.new(1, 1, 1)
VanGui.Draggable = true
VanGui.Position = UDim2.new(0, 33, 0, 343)
VanGui.Selectable = true
VanGui.Size = UDim2.new(0, 254, 0, 82)
VanGui.Style = Enum.FrameStyle.DropShadow
VanGui.Visible = false

VanTextButton.Name = "Van.TextButton"
VanTextButton.Parent = VanGui
VanTextButton.BackgroundColor3 = Color3.new(1, 1, 1)
VanTextButton.BackgroundTransparency = 0.5
VanTextButton.Position = UDim2.new(0, 30, 0, 41)
VanTextButton.Size = UDim2.new(0, 179, 0, 20)
VanTextButton.Font = Enum.Font.Arcade
VanTextButton.FontSize = Enum.FontSize.Size32
VanTextButton.Text = "VAN"
VanTextButton.TextSize = 30

VanTextBox.Name = "Van.TextBox"
VanTextBox.Parent = VanGui
VanTextBox.BackgroundColor3 = Color3.new(1, 1, 1)
VanTextBox.BackgroundTransparency = 0.5
VanTextBox.Position = UDim2.new(0, 32, 0, 0)
VanTextBox.Size = UDim2.new(0, 177, 0, 20)
VanTextBox.Font = Enum.Font.Arcade
VanTextBox.FontSize = Enum.FontSize.Size28
VanTextBox.Text = "name"
VanTextBox.TextSize = 25

VanGuiCloser.Name = "VanGuiCloser"
VanGuiCloser.Parent = VanGui
--VanGuiCloser.Visable = true
VanGuiCloser.BackgroundColor3 = Color3.new(1, 1, 1)
VanGuiCloser.BackgroundTransparency = 0.5
VanGuiCloser.Position = UDim2.new(0, 255, 0, 354)
VanGuiCloser.Size = UDim2.new(0, 20, 0, 14)
VanGuiCloser.Font = Enum.Font.SourceSans
VanGuiCloser.FontSize = Enum.FontSize.Size14
VanGuiCloser.Text = "X"
VanGuiCloser.TextSize = 14

OpenTextButton.MouseButton1Down:connect(function()
        game.CoreGui.VanScreenGui.VanGui.Visible = true
    game.CoreGui.VanScreenGui.OpenFrame.Visible = false
end)

VanGuiCloser.MouseButton1Down:connect(function()
        game.CoreGui.VanScreenGui.VanGui.Visible = false
    game.CoreGui.VanScreenGui.OpenFrame.Visible = true
end)

【问题讨论】:

    标签: lua scripting roblox


    【解决方案1】:

    如果你想摆脱打开按钮,那么只需使用 :Destroy()

    例子

    buttonname.MouseButton1Click:connect(function()
    game.CoreGui.openbuttonname:Destroy()
    end)
    

    如果那是您不想做的,请说得更清楚,因为很难理解您在说什么。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-12-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-09
      • 1970-01-01
      相关资源
      最近更新 更多