Search code examples
createjseaseljs

EaselJS way to change default pivot?


Pivot of stage is set to Left Top corner of canvas but I want Left Bottom corner. So then up is +y and right is +x

Is this possible?


Solution

  • It is not advisable to transform the stage -- there are some issues with how mouse coordinates are transformed.

    1. Put your contents in a Container instead
    2. Set the coordinates of the container to the stage width/height
    3. Move your contents into negative x/y

    If you absolutely must transform your stage, you can set the regX and regY to the stage width/height. It will move the contents, so you will have to counter-position the contents so they display properly.

    Hope that helps!