1

In my isometric flash game I have some models with long shadows. I want to ignore the mouse events (move, click, down and up) when the user performs any action on the shadow part of the image. (see sample image)

I know there is a way we can do it by creating a mask in flash. But what if I want to handle it on the .png images (bitmap)? Do I need to create a mask image for all such images? I think it will be very big deal unless there are easy ways (using tools in Photoshop).

Update: Looking for a "codable" solution to handle the shadows (like the one Richie_W said

Get the pixel colour value where the mouse was clicked - If it is the shadow colour you can then ignore the click

NOT a solution which involves art work, like creating mask asset or creating shadow asset etc

My friend told me cityville is not using masks but they are handling from code.

Does any one know how it can be done? OR

It can't be programed and only way is to create masks?

Sample image

dejjub-AIS
  • 1,501
  • 2
  • 24
  • 50

1 Answers1

4

There are a number of options you could try (IMO in order of solution quality):

  • Update your system to seperate out the shadow asset from the thing casting the shadow. From there it is easy to only attach a click listener to the correct asset. This system allows for future improvements such as changing the shadow asset at runtime (Different times of the day etc) without having to deal with updating the click listener node.

  • Get the pixel colour value where the mouse was clicked - If it is the shadow colour you can then ignore the click. This is a pretty flaky solution but quick to implement.

Richard Walton
  • 4,789
  • 3
  • 38
  • 49
  • separating shadow asset is another work for art department which I do not prefer unless it is the only way. Pixel color check is one option. Thanks – dejjub-AIS Feb 21 '12 at 12:42