Hello Guest

Author Topic: How to check if click on graphic (addgraphic)  (Read 1902 times)

0 Members and 1 Guest are viewing this topic.

PanKamil897

  • Member
  • Posts: 1
    • View Profile
How to check if click on graphic (addgraphic)
« on: June 28, 2016, 12:01:03 PM »
Hello. I want to create main menu. How to check whether user has clicked on graphic? (text)

And my second question.. Is this engine is currently developed? Or some future for this engine?


Regards.

TaintedGoat

  • Member
  • Posts: 8
    • View Profile
Re: How to check if click on graphic (addgraphic)
« Reply #1 on: June 28, 2016, 04:13:21 PM »
Hey PanKamil897! This forum isnt really visited by the frequent otter users. I would advice you to join the Slack Team if you're interested in this project, there you can ask questions and talk with the frequent Otter users. Here's the link to join http://otter2d.com/slack.php

1) To check if a graphic you could check if the mouse was clicked using Input.MouseButtonPressed for the click.
You could match the 'Entity' collider to be the same size as the 'Graphic' and use entity.Overlap(x,y)
If you want the entity hitbox to be diffrent from the 'Graphic' you could use Util.InRect(x,y,'Rectangle you want to check') or Util.InCircle(x,y,'Circle you want to check') if it would be better for what you're going for.

2) Yes, otter is being currently developed and there's a XNA version being worked on. If you would be interested in checking it out or the latest builds of Otter and OtterXNA they are here: https://bitbucket.org/kylepulver/

I hope it was helpful.

Kyle

  • Administrator
  • Member
  • Posts: 258
    • View Profile
Re: How to check if click on graphic (addgraphic)
« Reply #2 on: June 28, 2016, 06:33:37 PM »
Yep I am actively using Otter to develop my games, so I am still pushing changes and making updates all the time.  I've begun on the next iteration of the framework, but the current version is still being updated.