当前位置: 首页>>代码示例>>Java>>正文


Java DeferredResource类代码示例

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


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

示例1: update

import org.newdawn.slick.loading.DeferredResource; //导入依赖的package包/类
@Override public void update(GameContainer container, StateBasedGame game, int delta) throws SlickException {
	 
	// load three at a time.
	for (int i = 0; i < LoadingList.get().getRemainingResources(); ++i) {
		DeferredResource asset = LoadingList.get().getNext();
		if (asset != null) {
			try {
				asset.load();
			} catch (IOException e) {
				throw new SlickException("Issue asynchronously loading world resources: " + e.getMessage(), e);
			}
		} else {
			break;
		}
		
		if (i > 2)
			{ break; }
	}
	
	if (LoadingList.get().getRemainingResources() == 0 && timeInSplash > MIN_FRAMES_IN_SPLASH) {
		// Tell next state to actually build the world now that the graphics are in place; remember,
		// certain calculations require the actual graphics, such as determining the number of hazards.
		
		worldIsReady(game);
		game.enterState(
			Game.ID, 
			new FadeOutTransition(Color.black), 
			new FadeInTransition(Color.black));
	}
	
	++timeInSplash;
}
 
开发者ID:ErikaRedmark,项目名称:monkey-shines-java-port,代码行数:33,代码来源:SlickMonkeyShines.java


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