• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java LoadingList类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.newdawn.slick.loading.LoadingList的典型用法代码示例。如果您正苦于以下问题:Java LoadingList类的具体用法?Java LoadingList怎么用?Java LoadingList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



LoadingList类属于org.newdawn.slick.loading包,在下文中一共展示了LoadingList类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: init

import org.newdawn.slick.loading.LoadingList; //导入依赖的package包/类
/**
 * @see org.newdawn.slick.BasicGame#init(org.newdawn.slick.GameContainer)
 */
public void init(GameContainer container) throws SlickException {
	LoadingList.setDeferredLoading(true);
	
	new Sound("testdata/cbrown01.wav");
	new Sound("testdata/engine.wav");
	sound = new Sound("testdata/restart.ogg");
	new Music("testdata/testloop.ogg");
	music = new Music("testdata/SMB-X.XM");
	
	new Image("testdata/cursor.png");
	new Image("testdata/cursor.tga");
	new Image("testdata/cursor.png");
	new Image("testdata/cursor.png");
	new Image("testdata/dungeontiles.gif");
	new Image("testdata/logo.gif");
	image = new Image("testdata/logo.tga");
	new Image("testdata/logo.png");
	new Image("testdata/rocket.png");
	new Image("testdata/testpack.png");
	
	font = new AngelCodeFont("testdata/demo.fnt", "testdata/demo_00.tga");
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:26,代码来源:DeferredLoadingTest.java


示例2: render

import org.newdawn.slick.loading.LoadingList; //导入依赖的package包/类
/**
 * @see org.newdawn.slick.BasicGame#render(org.newdawn.slick.GameContainer, org.newdawn.slick.Graphics)
 */
public void render(GameContainer container, Graphics g) {
	if (nextResource != null) {
		g.drawString("Loading: "+nextResource.getDescription(), 100, 100);
	}
	
	int total = LoadingList.get().getTotalResources();
	int loaded = LoadingList.get().getTotalResources() - LoadingList.get().getRemainingResources();
	
	float bar = loaded / (float) total;
	g.fillRect(100,150,loaded*40,20);
	g.drawRect(100,150,total*40,20);
	
	if (started) {
		image.draw(100,200);
		font.drawString(100,500,"LOADING COMPLETE");
	}
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:21,代码来源:DeferredLoadingTest.java


示例3: init

import org.newdawn.slick.loading.LoadingList; //导入依赖的package包/类
public void init(GameContainer container, StateBasedGame game)
        throws SlickException {
    ConfigsManager.getInstance().applicateConfigs();
	LoadingList.setDeferredLoading(true);
    
    DatasManager.getInstance().addFile("LivingEntity.name", new TrueTypeFont(new Font("Verdana", Font.BOLD, 12), true));
    DatasManager.getInstance().addFile("TextEffect.damages", new TrueTypeFont(new Font("Verdana", Font.BOLD, 12), true));
    DatasManager.getInstance().addFile("TextEffect.status", new TrueTypeFont(new Font("Verdana", Font.BOLD, 14), true));
    
    DatasManager.getInstance().addFile("MouseCursor.default", new Image("res/images/cursors/default.png"));
    
    DatasManager.getInstance().addMap("test.tmx");
    try {
        ResourcesManager.getInstance().loadResources();
    } catch (Exception e) {
        throw new SlickException(e.getMessage());
    }
    super.init(container, game);
}
 
开发者ID:AlexMog,项目名称:MMO-Rulemasters-World,代码行数:20,代码来源:LoadingState.java


示例4: update

import org.newdawn.slick.loading.LoadingList; //导入依赖的package包/类
public void update(GameContainer container, StateBasedGame game, int delta)
        throws SlickException {
	super.update(container, game, delta);
    if (mResource != null) {
        try {
            mResource.load();
        } catch (IOException e) {
            throw new SlickException("Failed to load: " + mResource.getDescription(), e);
        }
        
        mResource = null;
    }
    
    mRemaining = LoadingList.get().getRemainingResources();
    mTotal = LoadingList.get().getTotalResources();
    if (LoadingList.get().getRemainingResources() > 0) {
        mResource = LoadingList.get().getNext();
    } else {
        ((Music)DatasManager.getInstance().getFile("Music.menu")).loop();
        game.enterState(1, new FadeOutTransition(Color.black), new FadeInTransition(Color.black));
    }
}
 
开发者ID:AlexMog,项目名称:MMO-Rulemasters-World,代码行数:23,代码来源:LoadingState.java


示例5: DeferredTexture

import org.newdawn.slick.loading.LoadingList; //导入依赖的package包/类
/**
 * Create a new deferred texture
 * 
 * @param in The input stream from which to read the texture
 * @param resourceName The name to give the resource
	 * @param flipped True if the image should be flipped
 * @param filter The filter to apply
 * @param trans The colour to defined as transparent
 */
public DeferredTexture(InputStream in, String resourceName, boolean flipped, int filter, int[] trans) {
	this.in = in;
	this.resourceName = resourceName;
	this.flipped = flipped;
	this.filter = filter;
	this.trans = trans;
	
	LoadingList.get().add(this);
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:19,代码来源:DeferredTexture.java


示例6: checkTarget

import org.newdawn.slick.loading.LoadingList; //导入依赖的package包/类
/**
 * Check if the target has been obtained already
 */
private void checkTarget() {
	if (target == null) {
		try {
			load();
			LoadingList.get().remove(this);
			return;
		} catch (IOException e) {
			throw new RuntimeException("Attempt to use deferred texture before loading and resource not found: "+resourceName);
		}
	}
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:15,代码来源:DeferredTexture.java


示例7: DeferredSound

import org.newdawn.slick.loading.LoadingList; //导入依赖的package包/类
/**
 * Create a new sound on request to load
 * 
 * @param ref The location of the sound to load
 * @param type The type of sound to load
 * @param in The input stream to load from
 */
public DeferredSound(String ref, InputStream in, int type) {
	this.ref = ref;
	this.type = type;
	
	// nasty hack to detect when we're loading from a stream
	if (ref.equals(in.toString())) {
		this.in = in;
	}
	
	LoadingList.get().add(this);
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:19,代码来源:DeferredSound.java


示例8: DeferredTexture

import org.newdawn.slick.loading.LoadingList; //导入依赖的package包/类
/**
 * Create a new deferred texture
 *
 * @param in The input stream from which to read the texture
 * @param resourceName The name to give the resource
  * @param flipped True if the image should be flipped
 * @param filter The filter to apply
 * @param trans The colour to defined as transparent
 */
public DeferredTexture(InputStream in, String resourceName, boolean flipped, int filter, @Nullable int[] trans) {
    this.in = in;
    this.resourceName = resourceName;
    this.flipped = flipped;
    this.filter = filter;
    this.trans = trans;

    LoadingList.get().add(this);
}
 
开发者ID:FOShameDotOrg,项目名称:fuzzy-octo-shame,代码行数:19,代码来源:DeferredTexture.java


示例9: checkTarget

import org.newdawn.slick.loading.LoadingList; //导入依赖的package包/类
/**
 * Check if the target has been obtained already
 */
private void checkTarget() {
    if (target == null) {
        try {
            load();
            LoadingList.get().remove(this);
        } catch (IOException e) {
            throw new RuntimeException("Attempt to use deferred texture before loading and resource not found: "+resourceName);
        }
    }
}
 
开发者ID:FOShameDotOrg,项目名称:fuzzy-octo-shame,代码行数:14,代码来源:DeferredTexture.java



注:本文中的org.newdawn.slick.loading.LoadingList类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TDeleteType类代码示例发布时间:2022-05-22
下一篇:
Java TimelineClient类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap