You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey. I am using Sprite.fromImage.
I need to change the pivot property in pixels, but as I understand it cannot be done =(
var image = Sprite.fromImage(img);
image.pivot = Offset(0.5555, 0.5555);
if print the pivot, can this:
Offset(0.5, 0.5)
Not even that Offset(0.5555, 0.5555);
These values are rounded and do not refer to local coordinates, but refer to the height and width of the sprite.
How to make them relative to local coordinates?
I want it to be like this:
image.size = Size(50.0, 50.0);
image.position = Offset(250.0, 250.0); // center of canvas; canvas width and height == 500.0;
image.rotation = 90.0;
image.pivot = Offset(image.size.width/2, 100.0);
Thanks.
The text was updated successfully, but these errors were encountered:
Hey. I am using Sprite.fromImage.
I need to change the pivot property in pixels, but as I understand it cannot be done =(
if print the pivot, can this:
Not even that Offset(0.5555, 0.5555);
These values are rounded and do not refer to local coordinates, but refer to the height and width of the sprite.
How to make them relative to local coordinates?
I want it to be like this:
Thanks.
The text was updated successfully, but these errors were encountered: