mouse 반응에 따라 그리고 화면 사이즈에 따라 image movieclip 이 scroll 되도록 제작하려면 상황이 제작할때마다 달라 상당히 번거로웠는데 모든 경우를 일반활 할 수 있도록 모듈을 제작했다.
scroll_mc —> 스크롤될 무비클립
scroll_mc._height > Stage.height 일 경우에만 –> scroll Active!!!
*limit position setting : mouse 가 화면에서 움직일경우 scroll_mc이 움직일수 있는 한계값을설정
Top–> Stage.height – scroll_mc._height
Bottom—> 0
*화면사이즈에 비례한 단위 움직임 계산
Stage.height : (Bottom-Top) = 1 : x
x= -(Bottom-Top)/Stage.height
= Top/Stage.height
= Stage.height – scroll_mc._height / Stage.height
= 1- scroll_mc._height/Stage.height
따라서 , 현재 mouse point 좌표값(Ymouse) 에서 scroll_mc 의 Target position !!!
==> Ymouse * 1- scroll_mc._height/Stage.height
Recent Comments