Java源码示例:basemod.animations.SpriterAnimation

示例1
public Wanderer(String name, PlayerClass setClass) {
    super(
            name,
            setClass,
            ENERGY_ORB_LAYER_TEXTURES,
            makeCharPath("wanderer/energy_orb/vfx.png"),
            null,
            loadIdleAnimation());

    idleAnimation = (SpriterAnimation) this.animation;
    postSnapAnimation = loadPostSnapAnimation();

    initializeClass(
            null,
            SHOULDER_DARK_TEXTURE,
            SHOULDER_LIT_TEXTURE,
            CORPSE_TEXTURE,
            getLoadout(), 0F, -10.0F, 160.0F, 280.0F, new EnergyManager(ENERGY_PER_TURN));

    this.dialogX = drawX + DIALOG_OFFSET_X;
    this.dialogY = drawY + DIALOG_OFFSET_Y;

    MemoryManager.forPlayer(this).renderForgottenMemories = true;
}
 
示例2
public TheTranquil(String name, PlayerClass setClass) {
    super(name, setClass, orbTextures, TranquilMod.makeCharacterImagePath("orb/vfx"), new SpriterAnimation(TranquilMod.makeCharacterImagePath("animation/animation.scml")));

    initializeClass(null, TranquilMod.makeCharacterImagePath("shoulder2"),
            TranquilMod.makeCharacterImagePath("shoulder"),
            TranquilMod.makeCharacterImagePath("corpse"),
            getLoadout(), 20.0F, -10.0F, 220.0F, 290.0F, new EnergyManager(ENERGY_PER_TURN));
}
 
示例3
public TheSeeker(String name, PlayerClass setClass) {
    super(name, setClass, orbTextures, SeekerMod.makePath("char/orb/vfx.png"), new SpriterAnimation(SeekerMod.makePath("char/animation.scml")));

    initializeClass(null, SeekerMod.makePath(SeekerMod.SEEKER_SHOULDER_2),
            SeekerMod.makePath(SeekerMod.SEEKER_SHOULDER_1),
            SeekerMod.makePath(SeekerMod.SEEKER_CORPSE),
            getLoadout(), 20.0F, -10.0F, 220.0F, 290.0F, new EnergyManager(ENERGY_PER_TURN));
}
 
示例4
private static SpriterAnimation loadIdleAnimation() {
    SpriterAnimation animation = new SpriterAnimation(makeCharPath("cull/idle_animation/idleanimation.scml"));
    animation.myPlayer.setScale(Settings.scale * 1.1F);
    return animation;
}
 
示例5
private static SpriterAnimation loadIdleAnimation() {
    SpriterAnimation animation = new SpriterAnimation(makeCharPath("wanderer/idle_animation/idleanimation.scml"));
    animation.myPlayer.setScale(Settings.scale * 1.1F);
    return animation;
}
 
示例6
private static SpriterAnimation loadPostSnapAnimation() {
    SpriterAnimation animation = new SpriterAnimation(makeCharPath("wanderer/post_snap_animation/wanderersnapped.scml"));
    animation.myPlayer.setScale(Settings.scale * 1.2F);
    return animation;
}
 
示例7
public void setAnimation(SpriterAnimation a) {
    this.animation = a;
}
 
示例8
public TheDefault(String name, PlayerClass setClass) {
    super(name, setClass, orbTextures,
            "theDefaultResources/images/char/defaultCharacter/orb/vfx.png", null,
            new SpriterAnimation(
                    "theDefaultResources/images/char/defaultCharacter/Spriter/theDefaultAnimation.scml"));


    // =============== TEXTURES, ENERGY, LOADOUT =================  

    initializeClass(null, // required call to load textures and setup energy/loadout.
            // I left these in DefaultMod.java (Ctrl+click them to see where they are, Ctrl+hover to see what they read.)
            THE_DEFAULT_SHOULDER_2, // campfire pose
            THE_DEFAULT_SHOULDER_1, // another campfire pose
            THE_DEFAULT_CORPSE, // dead corpse
            getLoadout(), 20.0F, -10.0F, 220.0F, 290.0F, new EnergyManager(ENERGY_PER_TURN)); // energy manager

    // =============== /TEXTURES, ENERGY, LOADOUT/ =================


    // =============== ANIMATIONS =================  

    loadAnimation(
            THE_DEFAULT_SKELETON_ATLAS,
            THE_DEFAULT_SKELETON_JSON,
            1.0f);
    AnimationState.TrackEntry e = state.setAnimation(0, "animation", true);
    e.setTime(e.getEndTime() * MathUtils.random());

    // =============== /ANIMATIONS/ =================


    // =============== TEXT BUBBLE LOCATION =================

    dialogX = (drawX + 0.0F * Settings.scale); // set location for text bubbles
    dialogY = (drawY + 220.0F * Settings.scale); // you can just copy these values

    // =============== /TEXT BUBBLE LOCATION/ =================

}