nulldesign/nd2d — Issue #40: globalToLocal in Node2D doesn't take camera.x/y into account
Author: mikedotalmond
Created: 2012-01-17 01:01:34+00:00
State: open

Hi,

I was working with localToGlobal on a project and found I was getting odd results when the camera moved. Adding camera.x/y to the localToGlobal output Point fixed my issue.

I have a fork of the project, but didn't think it was worth making a pull request for this, and I've been modifying other things in there that you probably don't want in the framework... feel free to merge it (or ask me to make a pull request) if you want though :)

Have a look at localToGlobal in Node2D.as in this commit, specifically, where the output Point is created/set:
https://github.com/mikedotalmond/nd2d/commit/a1f936c54f5a9fc0178e87d5c88915d08dff14fe

Also, the equivalent fix in (my modified version of) globalToLocal:
https://github.com/mikedotalmond/nd2d/commit/d8af9cde32dd58891d2fd438842539485dd57a1e

Thanks for making a fun library :)