Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是我试图弄清楚的有关 ActionScript3 / Flex 中显示对象的内容。假设您有一个显示对象,其注册点位于左上角,并且您想从其中心(显示对象的中间)缩放它,您如何使用 flash.geom.Matrix 类轻松实现这一点
谢谢你的帮助
这是通过将对象平移到所需的缩放/旋转中心、缩放/旋转它然后将其平移回来来完成的。
您可以通过连接矩阵来获得单个矩阵,从而使用单个矩阵来做到这一点:
var m:Matrix = new Matrix(); m.translate(-centerX, -centerY); m.scale(scaleX, scaleY); m.translate(centerX, centerY);