Search found 5 matches

by Deldrith
Wed May 04, 2016 8:17 pm
Forum: Support and Development
Topic: Non-rectangular buttons
Replies: 9
Views: 4176

Re: Non-rectangular buttons

This all being said... whenever I see hotspots/buttons/ui interaction implemented this way in a game or program it tears me up. I feel like, as a user, I shouldn't have to aim directly onto the button I want to click, I should just have to be close. Think about it like this: Imagine if in order to ...
by Deldrith
Sun May 01, 2016 2:53 pm
Forum: Support and Development
Topic: Non-rectangular buttons
Replies: 9
Views: 4176

Re: Non-rectangular buttons

https://love2d.org/wiki/ImageData:getPixel Get the image you're pointing to and check the alpha-component of the pixel where your mouse is pointing in that image. It totally works, I've used it for an adventure-type game (that I didn't finish). And as @rhughes suggests, you need to keep track of wh...
by Deldrith
Sun May 01, 2016 6:03 am
Forum: Support and Development
Topic: Non-rectangular buttons
Replies: 9
Views: 4176

Re: Non-rectangular buttons

Here's what I would do. First, I would have every object set up as a rectangle. When the mouse is at a certain position, I would get all the objects that I could be pointing at by testing to see if the cursor is in the rectangle. I would then sort these objects by their depth. Next, I would test th...
by Deldrith
Sun May 01, 2016 12:29 am
Forum: Support and Development
Topic: Non-rectangular buttons
Replies: 9
Views: 4176

Non-rectangular buttons

What I am attempting to do is make it so you can interact with an object when the mouse is over its image. For example, if there was a saw in the map, when a player put their mouse over it it would display "saw" and they could interact with it by clicking on it. This would be quite easy to...
by Deldrith
Fri Apr 08, 2016 6:55 pm
Forum: Support and Development
Topic: Avoiding Dropped Input
Replies: 6
Views: 2089

Avoiding Dropped Input

I was wondering what I should do in order to avoid input being dropped. Through testing, I realized that love.keyboard.isDown(key) would only return true if key was down when update() for that frame was running. Wanting to be able to get a true value even if a key is pressed and released quickly bet...