大佬教程收集整理的这篇文章主要介绍了来自 ReplicatedStorage 的克隆 Gui 框架在 StarterGui 中有父级,但仍然不可见,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试从 ReplicatedStorage 克隆一个框架并将其作为 StarterGui 中另一个框架的父级。我希望看到框架中的文本,但不能。当我在编辑器中手动复制 ReplicatedStorage 中的框架并将其拖动到 StarterGui 中的框架时,它工作正常,并且我可以看到文本。没有错误或警告。当我运行脚本并调用 updatedisplay 函数时,我可以从 ReplicatedStorage 中看到和移动帧的边缘,但不能看到和移动文本。
local ReplicatedStorage = game:Get@R_616_9260@ce("ReplicatedStorage")
local StarterGui = game:Get@R_616_9260@ce("StarterGui")
local updateresourcedisplay = ReplicatedStorage:WaitForChild("updateresourcedisplay")
local function updatedisplay(resources)
for key,value in pairs(resources) do
local newresource = ReplicatedStorage.resourceTemplate:Clone()
newresource.Parent = StarterGui.ScreenGui.leftFrame.Frame
end
end
updateresourcedisplay.onClIEntEvent:Connect(updatedisplay)
事实证明,StarterGui 仅用于...开始。如果您想在运行时更改播放器的 gui,请使用 PlayerGui 而不是 StarterGui。将第二行更改为以下代码并将引用从 StarterGui 替换为 PlayerGui 有效:
local PlayerGui = game:Get@R_616_9260@ce('Players').LocalPlayer:WaitForChild('PlayerGui')
以上是大佬教程为你收集整理的来自 ReplicatedStorage 的克隆 Gui 框架在 StarterGui 中有父级,但仍然不可见全部内容,希望文章能够帮你解决来自 ReplicatedStorage 的克隆 Gui 框架在 StarterGui 中有父级,但仍然不可见所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。