本文整理汇总了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;
}