funnygamemaker Posted March 9, 2015 Posted March 9, 2015 I've been doing some searching around for some help on creating my own GUI for leadwerks, I already know all about the leadwerks context references and I know about the FLOWgui but I would rather learn how to create my own for my projects and for furture projects.. But I'm looking for if anyone can point me in the right direction on creating or starting my own gui system that is based for the leadwerks indie version the LUA version. Thanks. Quote ~Morgan
Rick Posted March 9, 2015 Posted March 9, 2015 http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/context/contextdrawimage-r721 The above is what you'll be using for making a GUI in Leadwerks. You make gui like images and draw them with the above. How you draw them matters because of aspect ratio and screen resolution as well. Quote
funnygamemaker Posted March 9, 2015 Author Posted March 9, 2015 What would I do if i want to make the image, and or rectangle interactive with the mouse, like a button? Quote ~Morgan
Rick Posted March 9, 2015 Posted March 9, 2015 You check for mouse clicks over the image position on screen. This is a simple point in rect. function MouseOverArea(mpos, area) if mpos.x < area.x then return false if mpos.y < area.y then return false if mpos.x > area.x + area.width then return false if mpos.y > area.y + area.height then return false return true end local mousePos = App.window:GetMousePosition() -- the second argument is a table that holds the button dimensions if MouseOverArea(mousePos, { x = 0, y = 0, width = 100, height = 50}) then -- the mouse is over the rectangle area of our button end 2 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.