Sign in to follow this  
PicoFoundry

Defining a clickable area

Recommended Posts

I am making a little game that is similar in style to the Covert Front point and click adventure games (http://www.mateuszskutnik.com/covert_front/index.php?id=cf_1). Navigation is pretty easy, you click on doors, and sometimes parts of the bottom of the screen to move between them. Here are some screenshots from the Covert Front game to illustrate the type of thing I want to do:

GoBack.jpgDoors.jpg

In the first one you can click to go back when the cursor is near the bottom of the screen, and in the second one, you can change rooms by clicking near the bottom, or either door.

I made a simple prototype where I navigated using arrow sprites, as seen below, which worked well and were easy to use. However, I would prefer not to have buttons like this.proto.jpg

I was wondering what the best option would be to define clickable areas for movement. Should I create transparent sprites to define the doors and use the OnInputDown event as I did in the prototype, or would it be better to use a Rectangle, and check each onDown event to see if it is contained in the rectangle? I am wondering if there is a preferred method for doing something like this, or whether there are methods I have not thought about.

Share this post


Link to post
Share on other sites

Yeah, the sprite way is fine. I would set the alpha property to 0 like you said. That would be the easiest way, a lot of other ways too, but performance here is not an issue whatsoever so you should be good! :)

 

Edit: Infact, I do this same method with my tiled maps for making interactive NPC's / objects.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.