本文整理汇总了Java中com.watabou.gltextures.TextureCache.get方法的典型用法代码示例。如果您正苦于以下问题:Java TextureCache.get方法的具体用法?Java TextureCache.get怎么用?Java TextureCache.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.watabou.gltextures.TextureCache
的用法示例。
在下文中一共展示了TextureCache.get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: WndInfoBuff
import com.watabou.gltextures.TextureCache; //导入方法依赖的package包/类
public WndInfoBuff(Buff buff) {
super();
IconTitle titlebar = new IconTitle();
icons = TextureCache.get(Assets.BUFFS_LARGE);
film = new TextureFilm(icons, 16, 16);
Image buffIcon = new Image(icons);
buffIcon.frame(film.get(buff.icon()));
titlebar.icon(buffIcon);
titlebar.label(Messages.titleCase(buff.toString()), Window.TITLE_COLOR);
titlebar.setRect(0, 0, WIDTH, 0);
add(titlebar);
RenderedTextMultiline txtInfo = PixelScene.renderMultiline(buff.desc(), 6);
txtInfo.maxWidth(WIDTH);
txtInfo.setPos(titlebar.left(), titlebar.bottom() + GAP);
add(txtInfo);
resize(WIDTH, (int) (txtInfo.top() + txtInfo.height()));
}
示例2: NinePatch
import com.watabou.gltextures.TextureCache; //导入方法依赖的package包/类
public NinePatch( Object tx, int x, int y, int w, int h, int left, int top, int right, int bottom ) {
super( 0, 0, 0, 0 );
texture = TextureCache.get( tx );
w = w == 0 ? texture.width : w;
h = h == 0 ? texture.height : h;
nWidth = width = w;
nHeight = height = h;
vertices = new float[16];
verticesBuffer = Quad.createSet( 9 );
marginLeft = left;
marginRight = right;
marginTop = top;
marginBottom= bottom;
outterF = texture.uvRect( x, y, x + w, y + h );
innerF = texture.uvRect( x + left, y + top, x + w - right, y + h - bottom );
updateVertices();
}
示例3: NinePatch
import com.watabou.gltextures.TextureCache; //导入方法依赖的package包/类
public NinePatch( Object tx, int x, int y, int w, int h, int left, int top, int right, int bottom ) {
super( 0, 0, 0, 0 );
texture = TextureCache.get( tx );
w = w == 0 ? texture.width : w;
h = h == 0 ? texture.height : h;
nWidth = width = w;
nHeight = height = h;
vertices = new float[16];
quads = Quad.createSet( 9 );
marginLeft = left;
marginRight = right;
marginTop = top;
marginBottom= bottom;
outterF = texture.uvRect( x, y, x + w, y + h );
innerF = texture.uvRect( x + left, y + top, x + w - right, y + h - bottom );
updateVertices();
}
示例4: TextureFilm
import com.watabou.gltextures.TextureCache; //导入方法依赖的package包/类
public TextureFilm( Object tx, int width, int height ) {
SmartTexture texture = TextureCache.get( tx );
texWidth = texture.width;
texHeight = texture.height;
float uw = (float)width / texWidth;
float vh = (float)height / texHeight;
int cols = texWidth / width;
int rows = texHeight / height;
for (int i=0; i < rows; i++) {
for (int j=0; j < cols; j++) {
RectF rect = new RectF( j * uw, i * vh, (j+1) * uw, (i+1) * vh );
add( i * cols + j, rect );
}
}
}
示例5: WndInfoBuff
import com.watabou.gltextures.TextureCache; //导入方法依赖的package包/类
public WndInfoBuff(Buff buff){
super();
IconTitle titlebar = new IconTitle();
icons = TextureCache.get( Assets.BUFFS_LARGE );
film = new TextureFilm( icons, 16, 16 );
Image buffIcon = new Image( icons );
buffIcon.frame( film.get(buff.icon()) );
titlebar.icon( buffIcon );
titlebar.label( Messages.titleCase(buff.toString()), Window.TITLE_COLOR );
titlebar.setRect( 0, 0, WIDTH, 0 );
add( titlebar );
RenderedTextMultiline txtInfo = PixelScene.renderMultiline(buff.desc(), 6);
txtInfo.maxWidth(WIDTH);
txtInfo.setPos(titlebar.left(), titlebar.bottom() + GAP);
add( txtInfo );
resize( WIDTH, (int)(txtInfo.top() + txtInfo.height()) );
}
示例6: WndInfoBuff
import com.watabou.gltextures.TextureCache; //导入方法依赖的package包/类
public WndInfoBuff(Buff buff){
super();
IconTitle titlebar = new IconTitle();
icons = TextureCache.get( Assets.BUFFS_LARGE );
film = new TextureFilm( icons, 16, 16 );
Image buffIcon = new Image( icons );
buffIcon.frame( film.get(buff.icon()) );
titlebar.icon( buffIcon );
titlebar.label( Utils.capitalize(buff.toString()), Window.TITLE_COLOR );
titlebar.setRect( 0, 0, WIDTH, 0 );
add( titlebar );
BitmapTextMultiline txtInfo = PixelScene.createMultiline(buff.desc(), 6);
txtInfo.maxWidth = WIDTH;
txtInfo.measure();
txtInfo.x = titlebar.left();
txtInfo.y = titlebar.bottom() + GAP;
add( txtInfo );
resize( WIDTH, (int)(txtInfo.y + txtInfo.height()) );
}
示例7: pick
import com.watabou.gltextures.TextureCache; //导入方法依赖的package包/类
public static int pick( int index, int x, int y ) {
Bitmap bmp = TextureCache.get( Assets.ITEMS ).bitmap;
int rows = bmp.getWidth() / SIZE;
int row = index / rows;
int col = index % rows;
// FIXME: I'm assuming this is super slow?
final TextureData td = bmp.getTextureData();
if (!td.isPrepared()) {
td.prepare();
}
final Pixmap pixmap = td.consumePixmap();
int pixel = pixmap.getPixel(col * SIZE + x, row * SIZE + y);
pixmap.dispose();
return pixel;
}
示例8: NinePatch
import com.watabou.gltextures.TextureCache; //导入方法依赖的package包/类
public NinePatch(Object tx, int x, int y, int w, int h, int left, int top, int right, int bottom) {
super(0, 0, 0, 0);
texture = TextureCache.get(tx);
w = w == 0 ? texture.width : w;
h = h == 0 ? texture.height : h;
nWidth = width = w;
nHeight = height = h;
vertices = new float[16];
verticesBuffer = Quad.createSet(9);
marginLeft = left;
marginRight = right;
marginTop = top;
marginBottom = bottom;
outterF = texture.uvRect(x, y, x + w, y + h);
innerF = texture.uvRect(x + left, y + top, x + w - right, y + h - bottom);
updateVertices();
}
示例9: TextureFilm
import com.watabou.gltextures.TextureCache; //导入方法依赖的package包/类
public TextureFilm( Object tx, int width, int height ) {
texture = TextureCache.get( tx );
texWidth = texture.width;
texHeight = texture.height;
float uw = (float)width / texWidth;
float vh = (float)height / texHeight;
int cols = texWidth / width;
int rows = texHeight / height;
for (int i=0; i < rows; i++) {
for (int j=0; j < cols; j++) {
RectF rect = new RectF( j * uw, i * vh, (j+1) * uw, (i+1) * vh );
add( i * cols + j, rect );
}
}
}
示例10: NinePatch
import com.watabou.gltextures.TextureCache; //导入方法依赖的package包/类
public NinePatch( Object tx, int x, int y, int w, int h, int left, int top, int right, int bottom ) {
super( 0, 0, 0, 0 );
texture = TextureCache.get( tx );
w = w == 0 ? texture.width : w;
h = h == 0 ? texture.height : h;
nWidth = width = w;
nHeight = height = h;
vertices = new float[16];
quads = Quad.createSet( 9 );
marginLeft = left;
marginRight = right;
marginTop = top;
marginBottom= bottom;
outterF = texture.uvRect( x, y, x + w, y + h );
innerF = texture.uvRect( x + left, y + top, x + w - right, y + h - bottom );
updateVertices();
}
示例11: pick
import com.watabou.gltextures.TextureCache; //导入方法依赖的package包/类
public static int pick( int index, int x, int y ) {
Bitmap bmp = TextureCache.get( Assets.ITEMS ).bitmap;
int rows = bmp.getWidth() / SIZE;
int row = index / rows;
int col = index % rows;
return bmp.getPixel( col * SIZE + x, row * SIZE + y );
}
示例12: tiers
import com.watabou.gltextures.TextureCache; //导入方法依赖的package包/类
public static TextureFilm tiers() {
if (tiers == null) {
SmartTexture texture = TextureCache.get( Assets.BRIGAND );
tiers = new TextureFilm( texture, texture.width, FRAME_HEIGHT );
}
return tiers;
}
示例13: tiers
import com.watabou.gltextures.TextureCache; //导入方法依赖的package包/类
public static TextureFilm tiers() {
if (tiers == null) {
SmartTexture texture = TextureCache.get( Assets.ROGUE );
tiers = new TextureFilm( texture, texture.width, FRAME_HEIGHT );
}
return tiers;
}
示例14: pick
import com.watabou.gltextures.TextureCache; //导入方法依赖的package包/类
public static int pick(int index, int x, int y) {
Bitmap bmp = TextureCache.get(Assets.ITEMS).bitmap;
int rows = bmp.getWidth() / SIZE;
int row = index / rows;
int col = index % rows;
return bmp.getPixel(col * SIZE + x, row * SIZE + y);
}
示例15: pick
import com.watabou.gltextures.TextureCache; //导入方法依赖的package包/类
public static int pick( int index, int x, int y ) {
Pixmap bmp = TextureCache.get( Assets.ITEMS ).bitmap;
int rows = bmp.getWidth() / SIZE;
int row = index / rows;
int col = index % rows;
int pixel = bmp.getPixel(col * SIZE + x, row * SIZE + y);
return pixel;
}