coolsharp의 놀이터

'Fade In'에 해당되는 글 1건

  1. 2011.10.18 cocos2d for android - fade in, fade out
    /**
    * FileName : ActionsTest.java
    * Comment : 페이드 인, 페이드 아웃
    * @version : 1.0
    * @author : coolsharp
    * @date : 2011. 10. 18.
    */
    static class ActionFade extends ActionDemo {
        public void onEnter() {
            super.onEnter();

            centerSprites(2);

            // 불투명도 설정 보이지 않게 설정
            tamara.setOpacity(0);
            // 1초간 페이드 인
            CCFadeIn action1 = CCFadeIn.action(1.0f);
            // 거꾸로
            CCFadeOut action1Back = action1.reverse();

            // 1초간 페이드 아웃
            CCFadeOut action2 = CCFadeOut.action(1.0f);
            // 거꾸로
            CCFadeIn action2Back = action2.reverse();

            // 액션 실행
            tamara.runAction(CCSequence.actions(action1, action1Back));
            kathia.runAction(CCSequence.actions(action2, action2Back));
        }

        public String title() {
            return "FadeIn / FadeOut";
        }
    }

Posted by coolsharp