이미지박스 » Api

rotate

Description

컴포넌트 회전 효과를 설정하는 API이다.

회전 기준은 현재 회전된 상태가 아니라, 최초 회전이 되지 않은 상태가 기준이 된다. 만약 rotate 함수 호출 결과가 현재 회전된 상태와 동일한 경우에는, strFuncCallBack 파라미터에 해당하는 콜백 함수가 호출되지 않는다.

Parameters

Parameters Type Description
strAxis STRING 회전 축 문자열
nDegree short 회전 각도
nDuration long 회전 진행 시간(단위:ms)
strTiming STRING 회전 시간 방식
strCallbackFunc STRING 회전이 완료된 후 호출할 callback 함수명

Return Value

Type Description
BOOL 정상 처부 여부

Remark

strAxis 파라미터는 회전 축 문자열을 지정하며, 지정가능한 값은 "x"/"y"/"z"이다.

nDegree 파라미터는 회전 각도를 의미하며, 음수값 지정이 가능하다.

nDuration 파라미터는 단위는 밀리세컨드이다. 0값을 지정한 경우에는 strEasing 파라미터와 strFuncCallBack 파라미터는 무시된다.

strTiming 파라미터는 "ease", "linear" 두가지만을 지원한다. 공백 문자열로 지정한 경우에는 기본값으로 "ease"값이 사용된다.

strCallbackFunc 파라미터 값에 공백문자열을 지정하면, 콜백함수가 사용되지 않는다. 유효한 함수의 이름을 지정한 경우, 회전이 완료된 시점에 호출되며, 함수 파라미터로 컴포넌트 인스턴스와 strRotateAxis 파라미터, nRotateDegree 파라미터, nDuration 파라미터, strTiming 파라미터가 순차적으로 전달된다.

Example

// 현재 회전 상태 저장용 변수 var is_rotate = false; function img_rotate_on_click(objInst) { // 현재 회전 상태에 따라 180 또는 원복 처리 if(is_rotate == false) { is_rotate = true; img_rotate.rotate("y", 180, 400, "ease", "RotateCallback"); } else { is_rotate = false; img_rotate.rotate("y", 0, 400, "ease", "RotateCallback"); } } function RotateCallback(objInst, strAxis, nDegree, nDuration, strTiming) { factory.consoleprint("objInst = " + objInst.getname()); factory.consoleprint("strAxis = " + strAxis); factory.consoleprint("nDegree = " + nDegree); factory.consoleprint("nDuration = " + nDuration); factory.consoleprint("strTiming = " + strTiming); }

See Also

animate

Viewer Ver.

9.1.1.1

Update Date

20180228