0
我目前正在开发一款android游戏。画布矩阵转换
我已添加按钮以允许用户在x轴上导航相机并放大和缩小。
要做到这一点我用下面的矩阵码:
// c is the canvas..
Matrix m = c.getMatrix();
// Make sure that the ground is always at the bottom of the screen
m.setScale(zoom,zoom,0.0f,height);
m.preTranslate(camera_x, 0); // Change offset in x-direction
c.setMatrix(m);
这个工程在模拟器上,但给我我真正的设备上一些奇怪的结果。
谁能告诉我它有什么问题吗?我发现使用矩阵很棘手,特别是因为Matrix对象有很多选项可用(前置,后置和设置)。
感谢