Slimwaffle Posted July 2, 2018 Posted July 2, 2018 I was wondering if anyone could help me with a glitch I am experiencing with the gui. So I wanted to load a background image on the main menu.The problem is that it loads buggy then you click and it loads perfectly. The code I used looked like this; --GUI local gui = GUI:Create(context) gui:Hide() gui:SetScale(scale) local widget gui:GetBase():SetScript("Scripts/GUI/Panel.lua") gui:GetBase():SetObject("backgroundcolor",Vec4(0,0,0,1)) --This part is my code local image = gui:LoadImage("Frame/Walkabout.tex") local imagePanel = Widget:Panel(0,0,1920,1080, gui:GetBase()) imagePanel:SetImage(image) --Ends here GameMenu.gui=gui GameMenu.context = context How do I get this to load properly the first time without having to click? Quote
GorzenDev Posted July 3, 2018 Posted July 3, 2018 most widgets by default only redraw when interacted with, in your example a simple click on the panel redraws it. solution: add a call to imagePanel:Redraw() when you are finished creating your widgets or right after SetImage(). 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.