當前位置: 首頁>>代碼示例>>Java>>正文


Java Animation.PlayMode方法代碼示例

本文整理匯總了Java中com.badlogic.gdx.graphics.g2d.Animation.PlayMode方法的典型用法代碼示例。如果您正苦於以下問題:Java Animation.PlayMode方法的具體用法?Java Animation.PlayMode怎麽用?Java Animation.PlayMode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.badlogic.gdx.graphics.g2d.Animation的用法示例。


在下文中一共展示了Animation.PlayMode方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createAnimation

import com.badlogic.gdx.graphics.g2d.Animation; //導入方法依賴的package包/類
public static Animation createAnimation(TextureAtlas atlas,
        String regionName, float frameDuration, Animation.PlayMode mode) {
    ArrayList<TextureRegion> frames = new ArrayList<>();

    int idx = 0;
    TextureAtlas.AtlasRegion region;

    while ((region = atlas.findRegion(regionName, idx)) != null) {
        frames.add(region);
        idx++;
    }

    TextureRegion[] regions = new TextureRegion[idx];
    Animation anim = new Animation(frameDuration, frames.toArray(regions));
    anim.setPlayMode(mode);        
    return anim;
}
 
開發者ID:jh62,項目名稱:Battle-City-Multiplayer,代碼行數:18,代碼來源:Assets.java

示例2: AnimatedGraphicComponent

import com.badlogic.gdx.graphics.g2d.Animation; //導入方法依賴的package包/類
public AnimatedGraphicComponent(
    TextureAtlas textureAtlas,
    float animationTotalTime,
    float width,
    float height,
    PhysicsComponent physicsComponent,
    Animation.PlayMode playMode)
{
    super(physicsComponent, width, height);

    this.animationTime = Stopwatch.createStarted();
    this.textureAtlas = textureAtlas;
    this.animation = new Animation(
        animationTotalTime / this.textureAtlas.getRegions().size,
        this.textureAtlas.getRegions(),
        playMode);
}
 
開發者ID:overengineering,項目名稱:space-travels-3,代碼行數:18,代碼來源:AnimatedGraphicComponent.java

示例3: buildAnimation

import com.badlogic.gdx.graphics.g2d.Animation; //導入方法依賴的package包/類
private void buildAnimation(int TYPE, float frameDuration, String regionID, int[] indices, Animation.PlayMode playMode)
{
	Array<TextureRegion> regionArray = new Array<TextureRegion>();
	
	
	for(int i = 0; i < indices.length; i++)
	{
		regionArray.add(ChaseApp.menuControlsAtlas.findRegion(regionID, indices[i]));
	}
		
	controlAnimations[TYPE] = new Animation(frameDuration, regionArray);
	controlAnimations[TYPE].setPlayMode(playMode);
}
 
開發者ID:ChainGangChase,項目名稱:cgc-game,代碼行數:14,代碼來源:ControllerDrawer.java

示例4: AnimationSubView

import com.badlogic.gdx.graphics.g2d.Animation; //導入方法依賴的package包/類
public AnimationSubView(float frameDuration, Array<? extends TextureRegion> regions, Animation.PlayMode playType) {
    this.animation = new Animation(frameDuration, regions, playType);
    this.regions = regions;
    if (regions.size > 0) {
        TextureRegion region = regions.first();
        actor.setSize(region.getRegionWidth(), region.getRegionHeight());
    }
}
 
開發者ID:ratrecommends,項目名稱:dice-heroes,代碼行數:9,代碼來源:AnimationSubView.java


注:本文中的com.badlogic.gdx.graphics.g2d.Animation.PlayMode方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。