So, I’ve noticed that the Pixelmask of an Entity does not stay aligned with the graphic when the graphic’s scrollX and/or scrollY properties are set to something other than 1 and the camera point is something other than 0, 0.
I’ve found that I can override the update or render functions of the Entity and move the mask’s position via:
Pixelmask(mask).x = FP.camera.x - _maskOffset.x - (FP.camera.x * Image(graphic).scrollX);
Pixelmask(mask).y = FP.camera.y - _maskOffset.y - (FP.camera.y * Image(graphic).scrollY);
I’ve noticed that the mask lags behind the graphic (probably because this Entity updates before the camera) and this could be a problem for fast moving entities.
One alternative I entertained, but quickly dispatched with, was to not use the scrollX and scrollY properties, but rather re-position the Entity itself. This method could cause visible lag of the Entity’s graphic and not just the Pixelmask.
I was wondering if anyone had some insight on this or if there is a better way to position the mask using a different method.