flame-engine / flame

A Flutter based game engine.
https://flame-engine.org
MIT License
9.15k stars 895 forks source link

can support 【set transformMatrix(Matrix4 value)】 for Transform2D #3232

Open toly1994328 opened 1 month ago

toly1994328 commented 1 month ago

Problem to solve

When set position or zoom will notifyListeners immediately,But I want to be more flexible with Matrix4, Please support 【set transformMatrix(Matrix4 value)】 for Transform2D

Proposal

set transformMatrix(Matrix4 value) { _transformMatrix = value.clone(); notifyListeners(); }

More information

No response

Other

spydon commented 1 month ago

Sounds good Matrix4.setFrom should be used though so that it doesn't need to create a new object. Do you want to provide a PR for this?

toly1994328 commented 1 month ago

Sure, Thanks you . PR in https://github.com/flame-engine/flame/pull/3233 . Now, I can easily implement this interaction:

https://github.com/user-attachments/assets/f68e5f6e-cf4e-4cab-9cc3-f6484c76dc94

toly1994328 commented 1 month ago

oh, You should change this filed when set transformMatrix. This is difficult for me, so please handle it by your self ~

image