Java Code Examples for com.watabou.noosa.ui.Component#setRect()
The following examples show how to use
com.watabou.noosa.ui.Component#setRect() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WndTitledMessage.java From YetAnotherPixelDungeon with GNU General Public License v3.0 | 5 votes |
public WndTitledMessage( Component titlebar, String message ) { super(); int width = YetAnotherPixelDungeon.landscape() ? WIDTH_L : WIDTH_P; titlebar.setRect( 0, 0, width, 0 ); add( titlebar ); Highlighter hl = new Highlighter( message ); 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(); 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 ); } resize( width, (int)(normal.y + normal.height()) ); }
Example 2
Source File: WndTitledMessage.java From unleashed-pixel-dungeon with GNU General Public License v3.0 | 5 votes |
public WndTitledMessage( Component titlebar, String message ) { super(); int width = ShatteredPixelDungeon.landscape() ? WIDTH_L : WIDTH_P; titlebar.setRect( 0, 0, width, 0 ); add( titlebar ); Highlighter hl = new Highlighter( message ); 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(); 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 ); } resize( width, (int)(normal.y + normal.height()) ); }
Example 3
Source File: WndTitledMessage.java From remixed-dungeon with GNU General Public License v3.0 | 5 votes |
public WndTitledMessage( Component titlebar, String message ) { super(); resizeLimited(STD_WIDTH); titlebar.setRect( 0, 0, width, 0 ); add( titlebar ); Highlighter hl = new Highlighter( message ); Text normal = PixelScene.createMultiline(hl.text, GuiProperties.regularFontSize()); if (hl.isHighlighted()) { normal.mask = hl.inverted(); } normal.maxWidth(width); normal.x = titlebar.left(); normal.y = titlebar.bottom() + 2*GAP; add(normal); if (hl.isHighlighted()) { Text highlighted = PixelScene.createMultiline(hl.text, GuiProperties.regularFontSize()); highlighted.mask = hl.mask; highlighted.maxWidth(normal.getMaxWidth()); highlighted.x = normal.x; highlighted.y = normal.y; add(highlighted); highlighted.hardlight(TITLE_COLOR); } resize( width, (int)(normal.y + normal.height()) ); }
Example 4
Source File: WndTitledMessage.java From pixel-dungeon with GNU General Public License v3.0 | 4 votes |
public WndTitledMessage( Component titlebar, String message ) { super(); int width = PixelDungeon.landscape() ? WIDTH_L : WIDTH_P; titlebar.setRect( 0, 0, width, 0 ); add( titlebar ); HighlightedText text = new HighlightedText( 6 ); text.text( message, width ); text.setPos( titlebar.left(), titlebar.bottom() + GAP ); add( text ); resize( width, (int)text.bottom() ); }
Example 5
Source File: WndTitledMessage.java From shattered-pixel-dungeon with GNU General Public License v3.0 | 4 votes |
public WndTitledMessage( Component titlebar, String message ) { super(); int width = PixelScene.landscape() ? WIDTH_L : WIDTH_P; titlebar.setRect( 0, 0, width, 0 ); add(titlebar); RenderedTextBlock text = PixelScene.renderTextBlock( 6 ); text.text( message, width ); text.setPos( titlebar.left(), titlebar.bottom() + 2*GAP ); add( text ); resize( width, (int)text.bottom() + 2 ); }
Example 6
Source File: WndTitledMessage.java From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 | 4 votes |
public WndTitledMessage( Component titlebar, String message ) { super(); int width = SPDSettings.landscape() ? WIDTH_L : WIDTH_P; titlebar.setRect( 0, 0, width, 0 ); add(titlebar); RenderedTextBlock text = PixelScene.renderTextBlock( 6 ); text.text( message, width ); text.setPos( titlebar.left(), titlebar.bottom() + 2*GAP ); add( text ); resize( width, (int)text.bottom() + 2 ); }