tzachshabtay / MonoAGS

AGS (Adventure Game Studio) reimagined in Mono
https://tzachshabtay.github.io/MonoAGS/
Artistic License 2.0
27 stars 8 forks source link

Matching object with areas does not take object's parent into account #271

Closed ghost closed 6 years ago

ghost commented 6 years ago

First noticed in AGSCamera class, but this seems to be a universal issue in the engine.

Whenever there is a need to find an area the object is located on, engine code simply uses object's XY coordinates. However, if object has parent(s), these could be relative coordinates, not absolute ones.

These places in code may be found by searching for "GetMatchingAreas" method call. At the moment they include:

As far as I could get, current workaround is to apply transformation to the Area to make it match object's coordinates transformation (i.e. - move and/or rotate it accordingly). This ofcourse won't work if you want several objects with different parents (or some having parents and others not) be affected by one area.

NOTE: TBH I do not know if parallax should also be affecting coordinates in the above cases. If yes, then #270 should perhaps be closed as a more narrow case of current issue.