当前位置: 首页>>代码示例>>Java>>正文


Java BitmapTextMultiline.hardlight方法代码示例

本文整理汇总了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 );
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:37,代码来源:WndOptions.java

示例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();
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:47,代码来源:AboutScene.java

示例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 );
}
 
开发者ID:ConsideredHamster,项目名称:YetAnotherPixelDungeon,代码行数:45,代码来源:WndOptions.java

示例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() );
}
 
开发者ID:ConsideredHamster,项目名称:YetAnotherPixelDungeon,代码行数:65,代码来源:WndChooseWay.java

示例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();
}
 
开发者ID:HalcyonFish,项目名称:OHSCompSciClubPixelDungeon,代码行数:48,代码来源:AboutScene.java

示例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();
    }
 
开发者ID:skynet67,项目名称:pixel-dungeon-rebirth,代码行数:61,代码来源:AboutScene.java


注:本文中的com.watabou.noosa.BitmapTextMultiline.hardlight方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。