TEPA6ANT Posted March 23, 2019 Share Posted March 23, 2019 How painting texture in GUI without the use of widgets or painting texture[Texture:Load()] (not image[gui:LoadImage()]) in Widget:Panel? Quote Link to comment Share on other sites More sharing options...
Josh Posted March 23, 2019 Share Posted March 23, 2019 You would want to use gui:DrawImage(). This will use either 3D rendering or the system 2D drawing commands, depending on how the GUI is being used. The GUI system does not handle "textures" it handles "images", which can be a texture behind-the-scenes but it is set up to work direct drawing onto windows. This is being done so that the future editor can use the exact same GUI. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
TEPA6ANT Posted March 24, 2019 Author Share Posted March 24, 2019 I just need to output some textures in the Widget:Panel. And also on them to use special shaders. Quote Link to comment Share on other sites More sharing options...
Josh Posted March 24, 2019 Share Posted March 24, 2019 The panel script actually already supports images. However, you need to call widget:Redraw() after setting the image to trigger a re-render. I am adding an internal call to make this automatic. local window = Window:Create() local context = Context:Create(window) local gui = GUI:Create(context) local base = gui:GetBase() base:SetScript("Scripts/GUI/Panel.lua") x=20 y=20 widget = Widget:Panel(x,y,400,120,base) local image = gui:LoadImage("Materials/Common/splash.tex") widget:SetImage(image) widget:Redraw() while true do if window:Closed() then return end if window:KeyHit(Key.Escape) then return end context:Sync() end As for custom shaders, the GUI system is not as flexible as the general 2D drawing system, and it has no concept of "shaders" right now because it needs to render the same things with the OS 2D drawing commands. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
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.