Package org.newdawn.slick

Examples of org.newdawn.slick.Animation.addFrame()


                try {
                    Image sprite = getEmergencySpriteSheet(emergencyType).getSprite(row, frame);
                    if (numberOfPeople != null) {
                        sprite.getGraphics().drawString("" + numberOfPeople, sprite.getWidth() / 2, sprite.getHeight() / 2);
                    }
                    emergencyAnimation.addFrame(sprite, 250);
                } catch (SlickException ex) {
                    Logger.getLogger(AnimationFactory.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        }
View Full Code Here


    }

    public static Animation getMenuBarAnimation() {
        Animation menuBarAnimation = new Animation();
     
        menuBarAnimation.addFrame(getMenuBarSpriteSheet().getSprite(0, 0), 1000);

        return menuBarAnimation;
    }

    public static Animation getEmergencyStatusAnimation( EmergencyType type, int total, int remaining) {
View Full Code Here

        Animation emergencyStatusAnimation = new Animation();
        emergencyStatusAnimation.setLooping(true);
        emergencyStatusAnimation.setAutoUpdate(true);
        if (type == EmergencyType.FIRE) {
            String percentage = calculatePercentage(total, remaining);
            emergencyStatusAnimation.addFrame(getFireEmergencyStatusSpriteSheet(percentage).getSprite(0, 0), 1000);
        }
        if (type == EmergencyType.HEART_ATTACK) {
            String percentage = calculatePercentage(total, remaining);
            emergencyStatusAnimation.addFrame(getHeartAttackEmergencyStatusSpriteSheet(percentage).getSprite(0, 0), 1000);
        }
View Full Code Here

            String percentage = calculatePercentage(total, remaining);
            emergencyStatusAnimation.addFrame(getFireEmergencyStatusSpriteSheet(percentage).getSprite(0, 0), 1000);
        }
        if (type == EmergencyType.HEART_ATTACK) {
            String percentage = calculatePercentage(total, remaining);
            emergencyStatusAnimation.addFrame(getHeartAttackEmergencyStatusSpriteSheet(percentage).getSprite(0, 0), 1000);
        }
        return emergencyStatusAnimation;
    }

    public static SpriteSheet getAmbulanceSpriteSheet() {
View Full Code Here

        for (int row = 0; row < getGlowSpriteSheet().getHorizontalCount(); row++) {
            for (int frame = 0; frame < getGlowSpriteSheet().getVerticalCount(); frame++) {
                try {
                    Image sprite = getGlowSpriteSheet().getSprite(row, frame);
                    sprite.getGraphics().drawImage(graphicable.getAnimation().getCurrentFrame(), 0, 0);
                    glowAnimation.addFrame(sprite, 250);
                } catch (SlickException ex) {
                    Logger.getLogger(AnimationFactory.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        }
View Full Code Here

     * @return
     */
    private Animation setAnimationFromSheet(SpriteSheet sheet , int rigaSheet, int startNumFramAnimazione, int numFramAnimazione){
      Animation animation = new Animation();
        for (int frame=startNumFramAnimazione;frame<numFramAnimazione;frame++) {
          animation.addFrame(sheet.getSprite(frame,rigaSheet), 150);
        }
        animation.setAutoUpdate(false);
        return animation;
    }
 
View Full Code Here

     * @return
     */
    private Animation setAnimationFromSheet(SpriteSheet sheet , int rigaSheet, int startNumFramAnimazione, int numFramAnimazione){
      Animation animation = new Animation();
        for (int frame=startNumFramAnimazione;frame<numFramAnimazione;frame++) {
          animation.addFrame(sheet.getSprite(frame,rigaSheet), 150);
        }
        animation.setAutoUpdate(false);
        return animation;
    }

View Full Code Here

     * @return
     */
    private Animation setAnimationFromSheet(SpriteSheet sheet , int rigaSheet, int startNumFramAnimazione, int numFramAnimazione){
      Animation animation = new Animation();
        for (int frame=startNumFramAnimazione;frame<numFramAnimazione;frame++) {
          animation.addFrame(sheet.getSprite(frame,rigaSheet), 150);
        }
        animation.setAutoUpdate(false);
        return animation;
    }

View Full Code Here

     * @return
     */
    private Animation setAnimationFromSheet(SpriteSheet sheet , int rigaSheet, int startNumFramAnimazione, int numFramAnimazione){
      Animation animation = new Animation();
        for (int frame=startNumFramAnimazione;frame<numFramAnimazione;frame++) {
          animation.addFrame(sheet.getSprite(frame,rigaSheet), 150);
        }
        animation.setAutoUpdate(false);
        return animation;
    }
 
View Full Code Here

   
    public void addAnimation(SpriteSheet sheet,int duration){
          for(int y=0;y<sheet.getVerticalCount();y++){ 
            Animation animation=new Animation();
            for(int x=0;x<sheet.getHorizontalCount();x++){
                     animation.addFrame(sheet.getSprite(x, y), duration);
            }
            animation.setAutoUpdate(true);
            animations.add(animation);
          }
        setAnimation(0);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.