Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pivot property in pixels #65

Closed
Vasily-van-Zaam opened this issue Sep 19, 2020 · 0 comments
Closed

Pivot property in pixels #65

Vasily-van-Zaam opened this issue Sep 19, 2020 · 0 comments

Comments

@Vasily-van-Zaam
Copy link

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.

@spritewidget spritewidget locked and limited conversation to collaborators Apr 22, 2022
@vlidholt vlidholt converted this issue into discussion #75 Apr 22, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant