本文整理汇总了Java中com.watabou.noosa.NinePatch类的典型用法代码示例。如果您正苦于以下问题:Java NinePatch类的具体用法?Java NinePatch怎么用?Java NinePatch使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NinePatch类属于com.watabou.noosa包,在下文中一共展示了NinePatch类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: get
import com.watabou.noosa.NinePatch; //导入依赖的package包/类
public static NinePatch get( Type type ) {
switch (type) {
case WINDOW:
return new NinePatch( Assets.CHROME, 0, 0, 22, 22, 7 );
case TOAST:
return new NinePatch( Assets.CHROME, 22, 0, 18, 18, 5 );
case TOAST_TR:
return new NinePatch( Assets.CHROME, 40, 0, 18, 18, 5 );
case BUTTON:
return new NinePatch( Assets.CHROME, 58, 0, 6, 6, 2 );
case TAG:
return new NinePatch( Assets.CHROME, 22, 18, 16, 14, 3 );
case SCROLL:
return new NinePatch( Assets.CHROME, 32, 32, 32, 32, 5, 11, 5, 11 );
case TAB_SET:
return new NinePatch( Assets.CHROME, 64, 0, 22, 22, 7, 7, 7, 7 );
case TAB_SELECTED:
return new NinePatch( Assets.CHROME, 64, 22, 10, 14, 4, 7, 4, 6 );
case TAB_UNSELECTED:
return new NinePatch( Assets.CHROME, 74, 22, 10, 14, 4, 7, 4, 6 );
default:
return null;
}
}
示例2: get
import com.watabou.noosa.NinePatch; //导入依赖的package包/类
public static NinePatch get( Type type ) {
switch (type) {
case WINDOW:
return new NinePatch( Assets.CHROME, 0, 0, 22, 22, 7 );
case TOAST:
return new NinePatch( Assets.CHROME, 22, 0, 18, 18, 5 );
case TOAST_TR:
return new NinePatch( Assets.CHROME, 40, 0, 18, 18, 5 );
case BUTTON:
return new NinePatch( Assets.CHROME, 58, 0, 4, 4, 1 );
case TAG:
return new NinePatch( Assets.CHROME, 22, 18, 16, 14, 3 );
case SCROLL:
return new NinePatch( Assets.CHROME, 32, 32, 32, 32, 5, 11, 5, 11 );
case TAB_SET:
return new NinePatch( Assets.CHROME, 64, 0, 22, 22, 7, 7, 7, 7 );
case TAB_SELECTED:
return new NinePatch( Assets.CHROME, 64, 22, 10, 14, 4, 7, 4, 6 );
case TAB_UNSELECTED:
return new NinePatch( Assets.CHROME, 74, 22, 10, 14, 4, 7, 4, 6 );
default:
return null;
}
}
示例3: get
import com.watabou.noosa.NinePatch; //导入依赖的package包/类
public static NinePatch get( Type type ) {
switch (type) {
case WINDOW:
return new NinePatch( Assets.CHROME, 0, 0, 22, 22, 7 );
case TOAST:
return new NinePatch( Assets.CHROME, 22, 0, 18, 18, 5 );
case TOAST_TR:
return new NinePatch( Assets.CHROME, 40, 0, 18, 18, 5 );
case BUTTON:
return new NinePatch( Assets.CHROME, 58, 0, 4, 4, 1 );
case TAG:
return new NinePatch( Assets.CHROME, 22, 18, 16, 14, 3 );
case GEM:
return new NinePatch( Assets.CHROME, 0, 32, 32, 32, 13 );
case SCROLL:
return new NinePatch( Assets.CHROME, 32, 32, 32, 32, 5, 11, 5, 11 );
case TAB_SET:
return new NinePatch( Assets.CHROME, 64, 0, 22, 22, 7, 7, 7, 7 );
case TAB_SELECTED:
return new NinePatch( Assets.CHROME, 64, 22, 10, 14, 4, 7, 4, 6 );
case TAB_UNSELECTED:
return new NinePatch( Assets.CHROME, 74, 22, 10, 14, 4, 7, 4, 6 );
default:
return null;
}
}
示例4: get
import com.watabou.noosa.NinePatch; //导入依赖的package包/类
public static NinePatch get(Type type) {
switch (type) {
case WINDOW:
return new NinePatch(Assets.CHROME, 0, 0, 22, 22, 7);
case TOAST:
return new NinePatch(Assets.CHROME, 22, 0, 18, 18, 5);
case TOAST_TR:
return new NinePatch(Assets.CHROME, 40, 0, 18, 18, 5);
case BUTTON:
return new NinePatch(Assets.CHROME, 58, 0, 4, 4, 1);
case TAG:
return new NinePatch(Assets.CHROME, 22, 18, 16, 14, 3);
case SCROLL:
return new NinePatch(Assets.CHROME, 32, 32, 32, 32, 5, 11, 5, 11);
case TAB_SET:
return new NinePatch(Assets.CHROME, 64, 0, 22, 22, 7, 7, 7, 7);
case TAB_SELECTED:
return new NinePatch(Assets.CHROME, 64, 22, 10, 14, 4, 7, 4, 6);
case TAB_UNSELECTED:
return new NinePatch(Assets.CHROME, 74, 22, 10, 14, 4, 7, 4, 6);
default:
return null;
}
}
示例5: get
import com.watabou.noosa.NinePatch; //导入依赖的package包/类
public static NinePatch get( Type type ) {
switch (type) {
case WINDOW:
return new NinePatch( Assets.getChrome(), 0, 0, 22, 22, 7 );
case TOAST:
return new NinePatch( Assets.getChrome(), 22, 0, 18, 18, 5 );
case TOAST_TR:
return new NinePatch( Assets.getChrome(), 40, 0, 18, 18, 5 );
case BUTTON:
return new NinePatch( Assets.getChrome(), 58, 0, 4, 4, 1 );
case TAG:
return new NinePatch( Assets.getChrome(), 22, 18, 16, 14, 3 );
case GEM:
return new NinePatch( Assets.getChrome(), 0, 32, 32, 32, 13 );
case SCROLL:
return new NinePatch( Assets.getChrome(), 32, 32, 32, 32, 5, 11, 5, 11 );
case TAB_SET:
return new NinePatch( Assets.getChrome(), 64, 0, 22, 22, 7, 7, 7, 7 );
case TAB_SELECTED:
return new NinePatch( Assets.getChrome(), 64, 22, 10, 14, 4, 7, 4, 6 );
case TAB_UNSELECTED:
return new NinePatch( Assets.getChrome(), 74, 22, 10, 14, 4, 7, 4, 6 );
}
throw new TrackedRuntimeException("wrong chrome type");
}
示例6: get
import com.watabou.noosa.NinePatch; //导入依赖的package包/类
public static NinePatch get(Type type) {
String Asset = Assets.CHROME;
switch (type) {
case WINDOW:
return new NinePatch(Asset, 0, 0, 20, 20, 6);
case TOAST:
return new NinePatch(Asset, 22, 0, 18, 18, 5);
case TOAST_TR:
return new NinePatch(Asset, 40, 0, 18, 18, 5);
case BUTTON:
return new NinePatch(Asset, 58, 0, 4, 4, 1);
case TAG:
return new NinePatch(Asset, 22, 18, 16, 14, 3);
case GEM:
return new NinePatch(Asset, 0, 32, 32, 32, 13);
case SCROLL:
return new NinePatch(Asset, 32, 32, 32, 32, 5, 11, 5, 11);
case TAB_SET:
return new NinePatch(Asset, 64, 0, 20, 20, 6);
case TAB_SELECTED:
return new NinePatch(Asset, 65, 22, 8, 13, 3, 7, 3, 5);
case TAB_UNSELECTED:
return new NinePatch(Asset, 75, 22, 8, 13, 3, 7, 3, 5);
default:
return null;
}
}
示例7: get
import com.watabou.noosa.NinePatch; //导入依赖的package包/类
public static NinePatch get( Type type ) {
String Asset = Assets.CHROME;
switch (type) {
case WINDOW:
return new NinePatch( Asset, 0, 0, 20, 20, 6 );
case TOAST:
return new NinePatch( Asset, 22, 0, 18, 18, 5 );
case TOAST_TR:
return new NinePatch( Asset, 40, 0, 18, 18, 5 );
case BUTTON:
return new NinePatch( Asset, 58, 0, 6, 6, 2 );
case TAG:
return new NinePatch( Asset, 22, 18, 16, 14, 3 );
case GEM:
return new NinePatch( Asset, 0, 32, 32, 32, 13 );
case SCROLL:
return new NinePatch( Asset, 32, 32, 32, 32, 5, 11, 5, 11 );
case TAB_SET:
return new NinePatch( Asset, 64, 0, 20, 20, 6 );
case TAB_SELECTED:
return new NinePatch( Asset, 65, 22, 8, 13, 3, 7, 3, 5 );
case TAB_UNSELECTED:
return new NinePatch( Asset, 75, 22, 8, 13, 3, 7, 3, 5 );
default:
return null;
}
}
示例8: get
import com.watabou.noosa.NinePatch; //导入依赖的package包/类
public static NinePatch get( Type type ) {
String Asset = Assets.CHROME;
switch (type) {
case WINDOW:
return new NinePatch( Asset, 0, 0, 20, 20, 6 );
case TOAST:
return new NinePatch( Asset, 22, 0, 18, 18, 5 );
case TOAST_TR:
return new NinePatch( Asset, 40, 0, 18, 18, 5 );
case BUTTON:
return new NinePatch( Asset, 58, 0, 4, 4, 1 );
case TAG:
return new NinePatch( Asset, 22, 18, 16, 14, 3 );
case GEM:
return new NinePatch( Asset, 0, 32, 32, 32, 13 );
case SCROLL:
return new NinePatch( Asset, 32, 32, 32, 32, 5, 11, 5, 11 );
case TAB_SET:
return new NinePatch( Asset, 64, 0, 20, 20, 6 );
case TAB_SELECTED:
return new NinePatch( Asset, 65, 22, 8, 13, 3, 7, 3, 5 );
case TAB_UNSELECTED:
return new NinePatch( Asset, 75, 22, 8, 13, 3, 7, 3, 5 );
default:
return null;
}
}
示例9: Window
import com.watabou.noosa.NinePatch; //导入依赖的package包/类
public Window( int width, int height, NinePatch chrome ) {
super();
blocker = new TouchArea( 0, 0, PixelScene.uiCamera.width, PixelScene.uiCamera.height ) {
@Override
protected void onClick( Touch touch ) {
if (!Window.this.chrome.overlapsScreenPoint(
(int)touch.current.x,
(int)touch.current.y )) {
onBackPressed();
}
}
};
blocker.camera = PixelScene.uiCamera;
add( blocker );
this.chrome = chrome;
this.width = width;
this.height = height;
chrome.x = -chrome.marginLeft();
chrome.y = -chrome.marginTop();
chrome.size(
width - chrome.x + chrome.marginRight(),
height - chrome.y + chrome.marginBottom() );
add( chrome );
camera = new Camera( 0, 0,
(int)chrome.width,
(int)chrome.height,
PixelScene.defaultZoom );
camera.x = (int)(Game.width - camera.width * camera.zoom) / 2;
camera.y = (int)(Game.height - camera.height * camera.zoom) / 2;
camera.scroll.set( chrome.x, chrome.y );
Camera.add( camera );
Keys.event.add( this );
}
示例10: Window
import com.watabou.noosa.NinePatch; //导入依赖的package包/类
public Window( int width, int height, NinePatch chrome ) {
super();
TouchArea blocker = new TouchArea(0, 0, PixelScene.uiCamera.width, PixelScene.uiCamera.height) {
@Override
protected void onTouchDown(Touch touch) {
if (!Window.this.chrome.overlapsScreenPoint(
(int) touch.current.x,
(int) touch.current.y)) {
onBackPressed();
}
}
};
blocker.camera = PixelScene.uiCamera;
add(blocker);
this.chrome = chrome;
this.width = width;
this.height = height;
chrome.x = -chrome.marginLeft();
chrome.y = -chrome.marginTop();
chrome.size(
width - chrome.x + chrome.marginRight(),
height - chrome.y + chrome.marginBottom() );
add( chrome );
camera = new Camera( 0, 0,
(int)chrome.width,
(int)chrome.height,
PixelScene.defaultZoom );
camera.x = (int)(Game.width() - camera.width * camera.zoom) / 2;
camera.y = (int)(Game.height() - camera.height * camera.zoom) / 2;
camera.scroll.set( chrome.x, chrome.y );
Camera.add( camera );
Keys.event.add( this );
}
示例11: create
import com.watabou.noosa.NinePatch; //导入依赖的package包/类
@Override
public void create() {
super.create();
int w = Camera.main.width;
int h = Camera.main.height;
RenderedText title = PixelScene.renderText(Messages.get(this, "title"), 9);
title.hardlight(Window.TITLE_COLOR);
title.x = (w - title.width()) / 2;
title.y = 4;
align(title);
add(title);
ExitButton btnExit = new ExitButton();
btnExit.setPos(Camera.main.width - btnExit.width(), 0);
add(btnExit);
RenderedTextMultiline text = renderMultiline(TXT_Update, 6);
NinePatch panel = Chrome.get(Chrome.Type.TOAST);
int pw = 135 + panel.marginLeft() + panel.marginRight() - 2;
int ph = h - 16;
panel.size(pw, ph);
panel.x = (w - pw) / 2f;
panel.y = title.y + title.height();
align(panel);
add(panel);
ScrollPane list = new ScrollPane(new Component());
add(list);
Component content = list.content();
content.clear();
text.maxWidth((int) panel.innerWidth());
content.add(text);
content.setSize(panel.innerWidth(), (int) Math.ceil(text.height()));
list.setRect(
panel.x + panel.marginLeft(),
panel.y + panel.marginTop() - 1,
panel.innerWidth(),
panel.innerHeight() + 2);
list.scrollTo(0, 0);
Archs archs = new Archs();
archs.setSize(Camera.main.width, Camera.main.height);
addToBack(archs);
fadeIn();
}
示例12: createChildren
import com.watabou.noosa.NinePatch; //导入依赖的package包/类
@Override
protected void createChildren() {
bg = new NinePatch(Assets.STATUS, 80, 0, 30 + 18, 0);
add(bg);
add(new TouchArea(0, 1, 31, 31) {
@Override
protected void onClick(Touch touch) {
Image sprite = Dungeon.hero.sprite;
if (!sprite.isVisible()) {
Camera.main.focusOn(sprite);
}
GameScene.show(new WndHero());
}
});
btnMenu = new MenuButton();
add(btnMenu);
avatar = HeroSprite.avatar(Dungeon.hero.heroClass, lastTier);
add(avatar);
compass = new Compass(Dungeon.level.exit);
add(compass);
shield = new Image(Assets.SHLD_BAR);
// add(shield);
hp = new Image(Assets.HP_BAR);
add(hp);
exp = new Image(Assets.XP_BAR);
add(exp);
bossHP = new BossHealthBar();
add(bossHP);
level = new BitmapText(PixelScene.font1x);
level.hardlight(0xFFEBA4);
add(level);
depth = new BitmapText(Integer.toString(Dungeon.depth),
PixelScene.font1x);
depth.hardlight(0xCACFC2);
depth.measure();
add(depth);
Dungeon.hero.belongings.countIronKeys();
keys = new BitmapText(PixelScene.font1x);
keys.hardlight(0xCACFC2);
add(keys);
danger = new DangerIndicator();
add(danger);
buffs = new BuffIndicator(Dungeon.hero);
add(buffs);
}
示例13: create
import com.watabou.noosa.NinePatch; //导入依赖的package包/类
@Override
public void create() {
super.create();
int w = Camera.main.width;
int h = Camera.main.height;
RenderedText title = PixelScene.renderText( Messages.get(this, "title"), 9 );
title.hardlight(Window.TITLE_COLOR);
title.x = (w - title.width()) / 2 ;
title.y = 4;
align(title);
add(title);
ExitButton btnExit = new ExitButton();
btnExit.setPos( Camera.main.width - btnExit.width(), 0 );
add( btnExit );
RenderedTextMultiline text = renderMultiline(TXT_Update, 6 );
NinePatch panel = Chrome.get(Chrome.Type.TOAST);
int pw = 135 + panel.marginLeft() + panel.marginRight() - 2;
int ph = h - 16;
panel.size( pw, ph );
panel.x = (w - pw) / 2f;
panel.y = title.y + title.height();
align( panel );
add( panel );
ScrollPane list = new ScrollPane( new Component() );
add( list );
Component content = list.content();
content.clear();
text.maxWidth((int) panel.innerWidth());
content.add(text);
content.setSize( panel.innerWidth(), (int)Math.ceil(text.height()) );
list.setRect(
panel.x + panel.marginLeft(),
panel.y + panel.marginTop() - 1,
panel.innerWidth(),
panel.innerHeight() + 2);
list.scrollTo(0, 0);
Archs archs = new Archs();
archs.setSize( Camera.main.width, Camera.main.height );
addToBack( archs );
fadeIn();
}
示例14: Window
import com.watabou.noosa.NinePatch; //导入依赖的package包/类
public Window( int width, int height, NinePatch chrome ) {
this(width, height, 0, chrome);
}
示例15: createChildren
import com.watabou.noosa.NinePatch; //导入依赖的package包/类
@Override
protected void createChildren() {
bg = new NinePatch( Assets.STATUS, 0, 0, 128, 36, 85, 0, 45, 0 );
add( bg );
add( new TouchArea( 0, 1, 31, 31 ) {
@Override
protected void onClick( Touch touch ) {
Image sprite = Dungeon.hero.sprite;
if (!sprite.isVisible()) {
Camera.main.focusOn( sprite );
}
GameScene.show( new WndHero() );
}
} );
btnJournal = new JournalButton();
add( btnJournal );
btnMenu = new MenuButton();
add( btnMenu );
avatar = HeroSprite.avatar( Dungeon.hero.heroClass, lastTier );
add( avatar );
compass = new Compass( Dungeon.level.exit );
add( compass );
rawShielding = new Image( Assets.SHLD_BAR );
rawShielding.alpha(0.5f);
add(rawShielding);
shieldedHP = new Image( Assets.SHLD_BAR );
add(shieldedHP);
hp = new Image( Assets.HP_BAR );
add( hp );
exp = new Image( Assets.XP_BAR );
add( exp );
bossHP = new BossHealthBar();
add( bossHP );
level = new BitmapText( PixelScene.pixelFont);
level.hardlight( 0xFFEBA4 );
add( level );
depth = new BitmapText( Integer.toString( Dungeon.depth ), PixelScene.pixelFont);
depth.hardlight( 0xCACFC2 );
depth.measure();
add( depth );
danger = new DangerIndicator();
add( danger );
buffs = new BuffIndicator( Dungeon.hero );
add( buffs );
add( pickedUp = new Toolbar.PickedUpItem());
}