clickable object?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
Smooth203
Prole
Posts: 11
Joined: Mon Jun 15, 2015 3:47 pm

clickable object?

Post by Smooth203 »

Hello, I'm very new to this and I was wondering how I would create and object on screen that would not be able to pass through and it, when clicked on, open up a menu or something like that. Thanks. :nyu:
User avatar
T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

Re: clickable object?

Post by T-Bone »

I don't understand the part about not being able to pass through, but to make objects "clickable", well, there's no such concept built into Löve. What we typically do is to draw an object on screen, and keep track of where it is. Then when the user clicks, we check if the click was near or on the object in question, and if so do stuff. This approach allows great flexibility to how every aspect works.

This is fairly general for game development in Löve in general. It's not a game engine, it's a game framework. This gives you maximum freedom and control, but requires a bit more from the programmer to figure out how to make stuff work.
Smooth203
Prole
Posts: 11
Joined: Mon Jun 15, 2015 3:47 pm

Re: clickable object?

Post by Smooth203 »

oh okay, thank you
Smooth203
Prole
Posts: 11
Joined: Mon Jun 15, 2015 3:47 pm

Re: clickable object?

Post by Smooth203 »

what I meant by not passing through was the character not being able to, like, the way you can bind your character to the edge of the screen but not.. Sorry, I'm not very good with explaining.. :?
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 3 guests