本文整理汇总了Java中com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon.brightness方法的典型用法代码示例。如果您正苦于以下问题:Java ShatteredPixelDungeon.brightness方法的具体用法?Java ShatteredPixelDungeon.brightness怎么用?Java ShatteredPixelDungeon.brightness使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon
的用法示例。
在下文中一共展示了ShatteredPixelDungeon.brightness方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}