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


Java TextureCache.get方法代码示例

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

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

示例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();
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:24,代码来源:NinePatch.java

示例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 );
        }
    }
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:20,代码来源:TextureFilm.java

示例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()) );
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:24,代码来源:WndInfoBuff.java

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

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

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

示例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 );
        }
    }
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:20,代码来源:TextureFilm.java

示例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();
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon-gdx,代码行数:24,代码来源:NinePatch.java

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

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

示例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;
}
 
开发者ID:FthrNature,项目名称:unleashed-pixel-dungeon,代码行数:9,代码来源:HeroSprite.java

示例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);
}
 
开发者ID:NYRDS,项目名称:pixel-dungeon-remix,代码行数:8,代码来源:ItemSprite.java

示例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;
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon-gdx,代码行数:9,代码来源:ItemSprite.java


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