2013-07-25 2 views
0

나는 회전하는 바퀴를 개발하는 티타늄에서 일하고 있습니다. 휠을 이미지의 기본 위치에서 아래로 이동시킨 다음 휠을 새로운 중심으로 회전해야합니다 (아래로 이동 한 후).휠을 아래로 돌리고 중심에서 회전 [티타늄]

어떻게하면됩니까?

이것은 내가 작성한 코드입니다. 그러나 그것을 아래로 내리면 새로운 이동 된 중심을 회전시키지 않습니다.

var image = Titanium.UI.createImageView({ 
    backgroundImage:'test.png', 
    width: wheelWidth, 
    height:wheelHeight, 
    bottom:100 
    anchorPoint:{x:0.5, y:0.5} 
}); 
+0

상기 편집 – user782400

답변

0

이미지의 중앙을 중심으로 10도 회전합니다.

var animation = Ti.UI.createAnimation({ 
    anchorPoint : {x:0.5, y:0.5}, // Put this in only if on Android 
    transform : Ti.UI.create2DMatrix().rotate(10), // amount of rotation 
    duration : 2000 // Time this will take in milliseconds 
}); 
image.animate(animation); 
관련 문제