Will I break something with setting Tile.matrix like this:
matrix.a = 2;
matrix.tx = -10;
__transformDirty = true;
…or should I stick to:
var matrix = new Matrix(2, 0, 0, 1, -10);
this.matrix = matrix;
Will I break something with setting Tile.matrix like this:
matrix.a = 2;
matrix.tx = -10;
__transformDirty = true;
…or should I stick to:
var matrix = new Matrix(2, 0, 0, 1, -10);
this.matrix = matrix;
Does this work?
matrix.a = 2;
matrix.tx = -10;
this.matrix = matrix;
Looks like it does
Setting a “dirty” flag to true
is usually fine, but setting it to false
is almost always bad. This is why they’re usually private
.
Often, there’s a public
way to set the flag to true
, and if so, that’s recommended. In this case, it’s matrix = matrix
.