Jump to content

Lua Gui


funnygamemaker
 Share

Recommended Posts

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.

~Morgan

Link to comment
Share on other sites

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

  • Upvote 2
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...