; 立ち絵を動かすサブルーチンで呼ばれるサブルーチン。弄るのは・・・X,Y座標関係と傾きのみ?
@lcanimation
param %spname,%to.cx,%to.cy,%to.rot,%time
; SP "window:linebreak",{name={%ld1 , %ld2 , %ld1 , %ld2 , %ld1},xs=%size,ys=%size,cx=(%send_cx+%xpos),cy=(%send_cy+%ypos),animtime=100,animtype="round"}
GETSPINFO %spname,%from
; CPRINT %from.cx
;-----------------
; %from から %to の値に %time掛けて 移行させる処理
;------------------
RESETTIMER ;---- 時間処理開始
do
%nowtime=GETTIMER() ;---- 経過時間取得
if %nowtime > %time then
exit ;---- 経過時間が超過したらloopを抜ける
end if
;---- 全体の何割経過したかを %parcentへ算出
%parcent = %nowtime / %time

%now.cx = %from.cx - ((%from.cx - %to.cx) * %parcent)
%now.cy = %from.cy - ((%from.cy - %to.cy) * %parcent)
%now.rot = %from.rot - ((%from.rot - %to.rot) * %parcent)

; CPRINT "%parcent:"+STR(%parcent)+" / %now.cx:"+STR(%now.cx)+" / %now.cy:"+STR(%now.cy)+" / %now.rot:"+STR(%now.rot)

SPMOVELT %spname,%now.cx,%now.cy, %from.xs , %from.ys , %now.rot , 255
print #C
loop
; 【※】loop抜け@一番最後の処理で最終目標の to 値で表示させる。 cx,cyだけは中心位置が変更しないので、そもそもtoが存在しない
SPMOVELT %spname, %to.cx , %to.cy , %from.xs , %from.ys , %from.rot , 255
print #C
return