Ui 按钮不会在 roblox 中使用不同尺寸的屏幕移动相同的量

Ui button wont move the same amount with different size screens in roblox

提问人:Green_Truck50 提问时间:11/17/2023 最后编辑:Green_Truck50 更新时间:11/17/2023 访问量:15

问:

我有一个滑动的侧菜单,上面有一些按钮,但是当我调整屏幕大小(例如使工具箱变大)时,它不会显示所有(或没有)按钮,因为它不会向侧面移动相同的数量

这是我使用的代码:

local opening=false
local open=false
local buttonopen=script.Parent.open
buttonopen.MouseButton1Click:Connect(function()
    if opening==false then
        if open==false then
            opening=true
            buttonopen:TweenPosition(script.Parent["mv to"].Position, "Out", "Quad", .5)
            wait(.25)
            buttonopen.ImageLabel.Rotation=180
            wait(.25)
            opening=false
            open=true
        else
            opening=true
            buttonopen:TweenPosition(UDim2.new(0.005, 0, 0.42, 0), "Out", "Quad", .5)
            wait(.25)
            buttonopen.ImageLabel.Rotation=0
            wait(.25)
            opening=false
            open=false
        end
    end
end)

我尝试使用名为“mv to”的 UI 框架(如您在代码中看到的那样),但它不起作用

有什么帮助吗?

用户界面 菜单 Roblox

评论


答: 暂无答案