本文整理汇总了Java中com.watabou.noosa.Game.scene方法的典型用法代码示例。如果您正苦于以下问题:Java Game.scene方法的具体用法?Java Game.scene怎么用?Java Game.scene使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.watabou.noosa.Game
的用法示例。
在下文中一共展示了Game.scene方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onClick
import com.watabou.noosa.Game; //导入方法依赖的package包/类
@Override
protected void onClick() {
if (Game.scene() instanceof TitleScene) {
Game.instance.finish();
} else {
ShatteredPixelDungeon.switchNoFade(TitleScene.class);
}
}
示例2: onClick
import com.watabou.noosa.Game; //导入方法依赖的package包/类
@Override
protected void onClick() {
if (Game.scene() instanceof TitleScene) {
Game.instance.finish();
} else {
UNISTPixelDungeon.switchNoFade( TitleScene.class );
}
}
示例3: onClick
import com.watabou.noosa.Game; //导入方法依赖的package包/类
@Override
protected void onClick() {
if (Game.scene() instanceof TitleScene) {
Game.instance.finish();
} else {
PixelDungeon.switchNoFade( TitleScene.class );
}
}
示例4: create
import com.watabou.noosa.Game; //导入方法依赖的package包/类
@Override
public void create() {
super.create();
Music.INSTANCE.play( Assets.THEME, true );
Music.INSTANCE.volume( UNISTPixelDungeon.musicVol() / 10f );
uiCamera.visible = false;
int w = Camera.main.width;
int h = Camera.main.height;
Archs archs = new Archs();
archs.setSize( w, h );
add( archs );
float pw = Math.min( w, (UNISTPixelDungeon.landscape() ? MIN_WIDTH_L : MIN_WIDTH_P) * 3 ) - 16;
float ph = Math.min( h, (UNISTPixelDungeon.landscape() ? MIN_HEIGHT_L : MIN_HEIGHT_P) * 3 ) - 32;
float size = (float)Math.sqrt( pw * ph / 27f );
int nCols = (int)Math.ceil( pw / size );
int nRows = (int)Math.ceil( ph / size );
size = Math.min( pw / nCols, ph / nRows );
float left = (w - size * nCols) / 2;
float top = (h - size * nRows) / 2;
RenderedText title = PixelScene.renderText( Messages.get(this, "title"), 9 );
title.hardlight(Window.TITLE_COLOR);
title.x = (w - title.width()) / 2 ;
title.y = (top - title.baseLine()) / 2 ;
align(title);
add(title);
Badges.loadGlobal();
List<Badges.Badge> badges = Badges.filtered( true );
for (int i=0; i < nRows; i++) {
for (int j=0; j < nCols; j++) {
int index = i * nCols + j;
Badges.Badge b = index < badges.size() ? badges.get( index ) : null;
BadgeButton button = new BadgeButton( b );
button.setPos(
left + j * size + (size - button.width()) / 2,
top + i * size + (size - button.height()) / 2);
align(button);
add( button );
}
}
ExitButton btnExit = new ExitButton();
btnExit.setPos( Camera.main.width - btnExit.width(), 0 );
add( btnExit );
fadeIn();
Badges.loadingListener = new Callback() {
@Override
public void call() {
if (Game.scene() == BadgesScene.this) {
UNISTPixelDungeon.switchNoFade( BadgesScene.class );
}
}
};
}
示例5: create
import com.watabou.noosa.Game; //导入方法依赖的package包/类
@Override
public void create() {
super.create();
Music.INSTANCE.play( Assets.THEME, true );
Music.INSTANCE.volume( 1f );
uiCamera.visible = false;
int w = Camera.main.width;
int h = Camera.main.height;
Archs archs = new Archs();
archs.setSize( w, h );
add( archs );
int pw = (int)Math.min( w, (PixelDungeon.landscape() ? MIN_WIDTH_L : MIN_WIDTH_P) * 3 ) - 16;
int ph = (int)Math.min( h, (PixelDungeon.landscape() ? MIN_HEIGHT_L : MIN_HEIGHT_P) * 3 ) - 32;
float size = (float)Math.sqrt( pw * ph / 27f );
int nCols = (int)Math.ceil( pw / size );
int nRows = (int)Math.ceil( ph / size );
size = Math.min( pw / nCols, ph / nRows );
float left = (w - size * nCols) / 2;
float top = (h - size * nRows) / 2;
BitmapText title = PixelScene.createText( TXT_TITLE, 9 );
title.hardlight( Window.TITLE_COLOR );
title.measure();
title.x = align( (w - title.width()) / 2 );
title.y = align( (top - title.baseLine()) / 2 );
add( title );
Badges.loadGlobal();
List<Badges.Badge> badges = Badges.filtered( true );
for (int i=0; i < nRows; i++) {
for (int j=0; j < nCols; j++) {
int index = i * nCols + j;
Badges.Badge b = index < badges.size() ? badges.get( index ) : null;
BadgeButton button = new BadgeButton( b );
button.setPos(
left + j * size + (size - button.width()) / 2,
top + i * size + (size - button.height()) / 2);
add( button );
}
}
ExitButton btnExit = new ExitButton();
btnExit.setPos( Camera.main.width - btnExit.width(), 0 );
add( btnExit );
fadeIn();
Badges.loadingListener = new Callback() {
@Override
public void call() {
if (Game.scene() == BadgesScene.this) {
PixelDungeon.switchNoFade( BadgesScene.class );
}
}
};
}