本文整理汇总了Java中com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon.switchNoFade方法的典型用法代码示例。如果您正苦于以下问题:Java ShatteredPixelDungeon.switchNoFade方法的具体用法?Java ShatteredPixelDungeon.switchNoFade怎么用?Java ShatteredPixelDungeon.switchNoFade使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon
的用法示例。
在下文中一共展示了ShatteredPixelDungeon.switchNoFade方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onClick
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; //导入方法依赖的package包/类
@Override
protected void onClick() {
if (Game.scene() instanceof TitleScene) {
Game.instance.finish();
} else {
ShatteredPixelDungeon.switchNoFade( TitleScene.class );
}
}
示例2: onClick
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; //导入方法依赖的package包/类
@Override
protected void onClick() {
if (Game.scene() instanceof TitleScene) {
Game.instance.finish();
} else {
ShatteredPixelDungeon.switchNoFade( TitleScene.class );
}
}
示例3: onBackPressed
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; //导入方法依赖的package包/类
@Override
protected void onBackPressed() {
ShatteredPixelDungeon.switchNoFade(TitleScene.class);
}
示例4: onBackPressed
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; //导入方法依赖的package包/类
@Override
protected void onBackPressed() {
ShatteredPixelDungeon.switchNoFade(TitleScene.class);
}
示例5: onBackPressed
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; //导入方法依赖的package包/类
@Override
protected void onBackPressed() {
ShatteredPixelDungeon.switchNoFade( TitleScene.class );
}
示例6: create
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; //导入方法依赖的package包/类
@Override
public void create() {
super.create();
Music.INSTANCE.play( Assets.THEME, true );
uiCamera.visible = false;
int w = Camera.main.width;
int h = Camera.main.height;
Archs archs = new Archs();
archs.setSize( w, h );
add( archs );
float left = 5;
float top = 15;
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 );
int blankBadges = 34;
blankBadges -= badges.size();
if (badges.contains(Badges.Badge.ALL_ITEMS_IDENTIFIED)) blankBadges -= 6;
if (badges.contains(Badges.Badge.YASD)) blankBadges -= 5;
blankBadges = Math.max(0, blankBadges);
//guarantees a max of 5 rows in landscape, and 8 in portrait, assuming a max of 40 buttons
int nCols = ShatteredPixelDungeon.landscape() ? 7 : 4;
if (badges.size() + blankBadges > 32 && !ShatteredPixelDungeon.landscape()) nCols++;
int nRows = 1 + (blankBadges + badges.size())/nCols;
float badgeWidth = (w - 2*left)/nCols;
float badgeHeight = (h - 2*top)/nRows;
for (int i = 0; i < badges.size() + blankBadges; i++){
int row = i / nCols;
int col = i % nCols;
Badges.Badge b = i < badges.size() ? badges.get( i ) : null;
BadgeButton button = new BadgeButton( b );
button.setPos(
left + col * badgeWidth + (badgeWidth - button.width()) / 2,
top + row * badgeHeight + (badgeHeight - 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) {
ShatteredPixelDungeon.switchNoFade( BadgesScene.class );
}
}
};
}
示例7: onBackPressed
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; //导入方法依赖的package包/类
@Override
protected void onBackPressed() {
ShatteredPixelDungeon.switchNoFade( TitleScene.class );
}
示例8: onClick
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; //导入方法依赖的package包/类
@Override
protected void onClick() {
ShatteredPixelDungeon.switchNoFade(ChangesScene.class);
}
示例9: DisplayTab
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; //导入方法依赖的package包/类
public DisplayTab() {
super();
OptionSlider scale = new OptionSlider(Messages.get(this, "scale"),
(int)Math.ceil(2* Game.density)+ "X",
PixelScene.maxDefaultZoom + "X",
(int)Math.ceil(2* Game.density),
PixelScene.maxDefaultZoom ) {
@Override
protected void onChange() {
if (getSelectedValue() != ShatteredPixelDungeon.scale()) {
ShatteredPixelDungeon.scale(getSelectedValue());
ShatteredPixelDungeon.switchNoFade((Class<? extends PixelScene>) ShatteredPixelDungeon.scene().getClass(), new Game.SceneChangeCallback() {
@Override
public void beforeCreate() {
//do nothing
}
@Override
public void afterCreate() {
Game.scene().add(new WndSettings());
}
});
}
}
};
if ((int)Math.ceil(2* Game.density) < PixelScene.maxDefaultZoom) {
scale.setSelectedValue(PixelScene.defaultZoom);
scale.setRect(0, 0, WIDTH, SLIDER_HEIGHT);
add(scale);
}
RedButton btnResolution = new RedButton(Gdx.graphics.isFullscreen() ? TXT_SWITCH_WIN : TXT_SWITCH_FULL ) {
@Override
protected void onClick() {
ShatteredPixelDungeon.fullscreen(!ShatteredPixelDungeon.fullscreen());
}
};
btnResolution.enable(ShatteredPixelDungeon.instance.getPlatformSupport().isFullscreenEnabled() );
btnResolution.setRect(0, scale.bottom() + GAP_TINY, WIDTH, BTN_HEIGHT);
add(btnResolution);
OptionSlider brightness = new OptionSlider(Messages.get(this, "brightness"),
Messages.get(this, "dark"), Messages.get(this, "bright"), -2, 2) {
@Override
protected void onChange() {
ShatteredPixelDungeon.brightness(getSelectedValue());
}
};
brightness.setSelectedValue(ShatteredPixelDungeon.brightness());
brightness.setRect(0, btnResolution.bottom() + GAP_LRG, WIDTH, SLIDER_HEIGHT);
add(brightness);
OptionSlider tileGrid = new OptionSlider(Messages.get(this, "visual_grid"),
Messages.get(this, "off"), Messages.get(this, "high"), -1, 3) {
@Override
protected void onChange() {
ShatteredPixelDungeon.visualGrid(getSelectedValue());
}
};
tileGrid.setSelectedValue(ShatteredPixelDungeon.visualGrid());
tileGrid.setRect(0, brightness.bottom() + GAP_TINY, WIDTH, SLIDER_HEIGHT);
add(tileGrid);
}