coolsharp의 놀이터

cocos2d for android - Tint

2011. 10. 18. 18:57 : 개발
    /**
    * FileName : ActionsTest.java
    * Comment : 농도를 변경
    * @version : 1.0
    * @author : coolsharp
    * @date : 2011. 10. 18.
    */
    static class ActionTint extends ActionDemo {
        public void onEnter() {
            super.onEnter();

            centerSprites(2);

            // To는 절대적으로 rgb에 맞는 농도가 변경되고 By는 현재의 값에서 rgb가 추가되어 색상이 변경
            // R값 255, B값 255로 농도 변경
            CCTintTo action1 = CCTintTo.action(2, ccColor3B.ccc3(255, 0, 255));
            // R값 -127, G값 -255, B값 -127로 농도 변경
            CCTintBy action2 = CCTintBy.action(2, ccColor3B.ccc3(-127, -255, -127));
            // 거꾸로
            CCTintBy action2Back = action2.reverse();

            tamara.runAction(action1);
            kathia.runAction(CCSequence.actions(action2, action2Back));
        }

        public String title() {
            return "TintTo / TintBy";
        }
    }

Posted by coolsharp