Package net.rim.device.api.animation

Examples of net.rim.device.api.animation.Animation


        // Set up the animation. The animation will animate a scalar float value
        // (_mainRotation) from 360 to 0 over 3 seconds and will repeat
        // indefinitely.
        _animator = new Animator(0);
        final Animation animation =
                _animator.addAnimationFromTo(_mainRotation,
                        AnimatedScalar.ANIMATION_PROPERTY_SCALAR, 360.0f, 0.0f,
                        Animation.EASINGCURVE_LINEAR, 3000L);
        animation.setRepeatCount(Animation.REPEAT_COUNT_INDEFINITE);

        _animator.begin(0L);
    }
View Full Code Here


        _animator = new Animator(0);

        // Add an animation that will animate indefinitely
        // from 0.0 to 2.0*PI over 5 seconds.
        final float r = (float) (Math.PI * 2.0);
        final Animation animation =
                _animator.addAnimationFromTo(_rotation,
                        AnimatedScalar.ANIMATION_PROPERTY_SCALAR, 0.0f, r,
                        Animation.EASINGCURVE_LINEAR, 5000L);
        animation.setRepeatCount(Animation.REPEAT_COUNT_INDEFINITE);
        _animator.begin(0L);
    }
View Full Code Here

    private void initializeAnimation() {
        _animator = new Animator(0);

        // Add an animation that will animate indefinitely from 0.0 to 360.0
        // over 5 seconds.
        final Animation animation =
                _animator.addAnimationFromTo(_rotation,
                        AnimatedScalar.ANIMATION_PROPERTY_SCALAR, 0.0f, 360.0f,
                        Animation.EASINGCURVE_LINEAR, 5000L);
        animation.setRepeatCount(Animation.REPEAT_COUNT_INDEFINITE);
        _animator.begin(0L);
    }
View Full Code Here

            if (attributes.getValue(CURVE).equalsIgnoreCase(LINEAR)) {
                curve = Animation.EASINGCURVE_LINEAR;
            }

            Animation animation = null;

            // Check if the animation is a TRANSLATE
            if (attributes.getValue(TYPE).equalsIgnoreCase(TRANSLATE)) {
                animation =
                        parseTranslationAnimation(enemy, keyframes, keyTimes,
                                duration, curve, attributes);
            }

            // Check if the animation is a ROTATE
            else if (attributes.getValue(TYPE).equalsIgnoreCase(ROTATE)) {
                animation =
                        parseRotationAnimation(enemy, keyframes, keyTimes,
                                duration, curve, attributes);
            }

            // Check if the animation is a SCALE
            else if (attributes.getValue(TYPE).equalsIgnoreCase(SCALE)) {
                animation =
                        parseScaleAnimation(enemy, keyframes, keyTimes,
                                duration, curve, attributes);
            }

            // Add the animation to the enemy
            if (animation != null) {
                enemy.addAnimation(animation);

                final int repeatCount =
                        Integer.parseInt(attributes.getValue(REPEAT));
                if (repeatCount == -1) {
                    animation.setRepeatCount(Animation.REPEAT_COUNT_INDEFINITE);
                } else {
                    animation.setRepeatCount(repeatCount);
                }
            }
        }
View Full Code Here

TOP

Related Classes of net.rim.device.api.animation.Animation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.