本文整理汇总了Java中com.watabou.noosa.BitmapTextMultiline.hardlight方法的典型用法代码示例。如果您正苦于以下问题:Java BitmapTextMultiline.hardlight方法的具体用法?Java BitmapTextMultiline.hardlight怎么用?Java BitmapTextMultiline.hardlight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.watabou.noosa.BitmapTextMultiline
的用法示例。
在下文中一共展示了BitmapTextMultiline.hardlight方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: WndOptions
import com.watabou.noosa.BitmapTextMultiline; //导入方法依赖的package包/类
public WndOptions( String title, String message, String... options ) {
super();
BitmapTextMultiline tfTitle = PixelScene.createMultiline( title, 9 );
tfTitle.hardlight( TITLE_COLOR );
tfTitle.x = tfTitle.y = MARGIN;
tfTitle.maxWidth = WIDTH - MARGIN * 2;
tfTitle.measure();
add( tfTitle );
BitmapTextMultiline tfMesage = PixelScene.createMultiline( message, 8 );
tfMesage.maxWidth = WIDTH - MARGIN * 2;
tfMesage.measure();
tfMesage.x = MARGIN;
tfMesage.y = tfTitle.y + tfTitle.height() + MARGIN;
add( tfMesage );
float pos = tfMesage.y + tfMesage.height() + MARGIN;
for (int i=0; i < options.length; i++) {
final int index = i;
RedButton btn = new RedButton( options[i] ) {
@Override
protected void onClick() {
hide();
onSelect( index );
}
};
btn.setRect( MARGIN, pos, WIDTH - MARGIN * 2, BUTTON_HEIGHT );
add( btn );
pos += BUTTON_HEIGHT + MARGIN;
}
resize( WIDTH, (int)pos );
}
示例2: create
import com.watabou.noosa.BitmapTextMultiline; //导入方法依赖的package包/类
@Override
public void create() {
super.create();
BitmapTextMultiline text = createMultiline( TXT, 8 );
text.maxWidth = Math.min( Camera.main.width, 120 );
text.measure();
add( text );
text.x = align( (Camera.main.width - text.width()) / 2 );
text.y = align( (Camera.main.height - text.height()) / 2 );
BitmapTextMultiline link = createMultiline( LNK, 8 );
link.maxWidth = Math.min( Camera.main.width, 120 );
link.measure();
link.hardlight( Window.TITLE_COLOR );
add( link );
link.x = text.x;
link.y = text.y + text.height();
TouchArea hotArea = new TouchArea( link ) {
@Override
protected void onClick( NoosaInputProcessor.Touch touch ) {
Gdx.net.openURI("http://" + LNK);
}
};
add( hotArea );
Image wata = Icons.WATA.get();
wata.x = align( text.x + (text.width() - wata.width) / 2 );
wata.y = text.y - wata.height - 8;
add( wata );
new Flare( 7, 64 ).color( 0x112233, true ).show( wata, 0 ).angularSpeed = +20;
Archs archs = new Archs();
archs.setSize( Camera.main.width, Camera.main.height );
addToBack( archs );
ExitButton btnExit = new ExitButton();
btnExit.setPos( Camera.main.width - btnExit.width(), 0 );
add( btnExit );
fadeIn();
}
示例3: WndOptions
import com.watabou.noosa.BitmapTextMultiline; //导入方法依赖的package包/类
public WndOptions( String title, String message, String... options ) {
super();
this.disabled = disabled();
BitmapTextMultiline tfTitle = PixelScene.createMultiline( title, 9 );
tfTitle.hardlight( TITLE_COLOR );
tfTitle.x = tfTitle.y = MARGIN;
tfTitle.maxWidth = WIDTH - MARGIN * 2;
tfTitle.measure();
add( tfTitle );
BitmapTextMultiline tfMessage = PixelScene.createMultiline( message, 7 );
tfMessage.maxWidth = WIDTH - MARGIN * 2;
tfMessage.measure();
tfMessage.x = MARGIN;
tfMessage.y = tfTitle.y + tfTitle.height() + MARGIN;
add( tfMessage );
float pos = tfMessage.y + tfMessage.height() + MARGIN;
for (int i=0; i < options.length; i++) {
final int index = i;
RedButton btn = new RedButton( options[i] ) {
@Override
protected void onClick() {
hide();
onSelect( index );
}
};
if( disabled != null && disabled.contains( index ) ) {
btn.textColor( DISABLED_COLOR );
}
btn.setRect( MARGIN, pos, WIDTH - MARGIN * 2, BUTTON_HEIGHT );
add( btn );
pos += BUTTON_HEIGHT + MARGIN;
}
resize( WIDTH, (int)pos );
}
示例4: WndChooseWay
import com.watabou.noosa.BitmapTextMultiline; //导入方法依赖的package包/类
public WndChooseWay( final TomeOfMastery tome, final HeroSubClass way1, final HeroSubClass way2 ) {
super();
IconTitle titlebar = new IconTitle();
titlebar.icon( new ItemSprite( tome.image(), null ) );
titlebar.label( tome.name() );
titlebar.setRect( 0, 0, WIDTH, 0 );
add( titlebar );
Highlighter hl = new Highlighter( way1.desc() + "\n\n" + way2.desc() + "\n\n" + TXT_MESSAGE );
BitmapTextMultiline normal = PixelScene.createMultiline( hl.text, 6 );
normal.maxWidth = WIDTH;
normal.measure();
normal.x = titlebar.left();
normal.y = titlebar.bottom() + GAP;
add( normal );
if (hl.isHighlighted()) {
normal.mask = hl.inverted();
BitmapTextMultiline highlighted = PixelScene.createMultiline( hl.text, 6 );
highlighted.maxWidth = normal.maxWidth;
highlighted.measure();
highlighted.x = normal.x;
highlighted.y = normal.y;
add( highlighted );
highlighted.mask = hl.mask;
highlighted.hardlight( TITLE_COLOR );
}
RedButton btnWay1 = new RedButton( Utils.capitalize( way1.title() ) ) {
@Override
protected void onClick() {
hide();
tome.choose( way1 );
}
};
btnWay1.setRect( 0, normal.y + normal.height() + GAP, (WIDTH - GAP) / 2, BTN_HEIGHT );
add( btnWay1 );
RedButton btnWay2 = new RedButton( Utils.capitalize( way2.title() ) ) {
@Override
protected void onClick() {
hide();
tome.choose( way2 );
}
};
btnWay2.setRect( btnWay1.right() + GAP, btnWay1.top(), btnWay1.width(), BTN_HEIGHT );
add( btnWay2 );
RedButton btnCancel = new RedButton( TXT_CANCEL ) {
@Override
protected void onClick() {
hide();
}
};
btnCancel.setRect( 0, btnWay2.bottom() + GAP, WIDTH, BTN_HEIGHT );
add( btnCancel );
resize( WIDTH, (int)btnCancel.bottom() );
}
示例5: create
import com.watabou.noosa.BitmapTextMultiline; //导入方法依赖的package包/类
@Override
public void create() {
super.create();
BitmapTextMultiline text = createMultiline( TXT, 8 );
text.maxWidth = Math.min( Camera.main.width, 120 );
text.measure();
add( text );
text.x = align( (Camera.main.width - text.width()) / 2 );
text.y = align( (Camera.main.height - text.height()) / 2 );
BitmapTextMultiline link = createMultiline( LNK, 8 );
link.maxWidth = Math.min( Camera.main.width, 120 );
link.measure();
link.hardlight( Window.TITLE_COLOR );
add( link );
link.x = text.x;
link.y = text.y + text.height();
TouchArea hotArea = new TouchArea( link ) {
@Override
protected void onClick( Touch touch ) {
Intent intent = new Intent( Intent.ACTION_VIEW, Uri.parse( "http://" + LNK ) );
Game.instance.startActivity( intent );
}
};
add( hotArea );
Image wata = Icons.WATA.get();
wata.x = align( (Camera.main.width - wata.width) / 2 );
wata.y = text.y - wata.height - 8;
add( wata );
new Flare( 7, 64 ).color( 0x112233, true ).show( wata, 0 ).angularSpeed = +20;
Archs archs = new Archs();
archs.setSize( Camera.main.width, Camera.main.height );
addToBack( archs );
ExitButton btnExit = new ExitButton();
btnExit.setPos( Camera.main.width - btnExit.width(), 0 );
add( btnExit );
fadeIn();
}
示例6: create
import com.watabou.noosa.BitmapTextMultiline; //导入方法依赖的package包/类
@Override
public void create() {
super.create();
BitmapTextMultiline text = createMultiline(TXT, 8);
text.maxWidth = Math.min(Camera.main.width, 120);
text.measure();
add(text);
text.x = align((Camera.main.width - text.width()) / 2);
text.y = align((Camera.main.height - text.height()) / 2);
BitmapTextMultiline link = createMultiline(LNK, 8);
link.maxWidth = Math.min(Camera.main.width, 120);
link.measure();
link.hardlight(Window.TITLE_COLOR);
add(link);
link.x = text.x;
link.y = text.y + text.height();
TouchArea hotArea = new TouchArea(link) {
@Override
protected void onClick(NoosaInputProcessor.Touch touch) {
Gdx.net.openURI("http://" + LNK);
//TODO run action for platform
// Intent intent = new Intent( Intent.ACTION_VIEW, Uri.parse( "http://" + LNK ) );
// Game.instance.startActivity( intent );
}
};
add(hotArea);
if(Gdx.app.getType() == Application.ApplicationType.iOS) {
BitmapTextMultiline iosTxt = createMultiline(IOS_PORT_TXT, 8);
iosTxt.maxWidth = Math.min(Camera.main.width, 120);
iosTxt.measure();
add(iosTxt);
iosTxt.x = link.x;
iosTxt.y = link.y + link.height();
}
Image wata = Icons.WATA.get();
wata.x = align((Camera.main.width - wata.width) / 2);
wata.y = text.y - wata.height - 8;
add(wata);
new Flare(7, 64).color(0x112233, true).show(wata, 0).angularSpeed = +20;
Archs archs = new Archs();
archs.setSize(Camera.main.width, Camera.main.height);
addToBack(archs);
ExitButton btnExit = new ExitButton();
btnExit.setPos(Camera.main.width - btnExit.width(), 0);
add(btnExit);
fadeIn();
}