public float width( Object id ){ return width( get( id ) ); }
public float width( Object id ){ return width( get( id ) ); }
public TextureFilm( TextureFilm atlas, Object key, int width, int height ) { texWidth = atlas.texWidth; texHeight = atlas.texHeight; RectF patch = atlas.get( key ); float uw = (float)width / texWidth; float vh = (float)height / texHeight; float pwidth = Math.round(width( patch )); float pheight = Math.round(height( patch )); int cols = (int)(pwidth / width); int rows = (int)(pheight / 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 ); rect.offset( patch.left, patch.top ); add( i * cols + j, rect ); } } }
public Tilemap( Object tx, TextureFilm tileset ) { super( 0, 0, 0, 0 ); this.texture = TextureCache.get( tx ); this.tileset = tileset; RectF r = tileset.get( 0 ); cellW = tileset.width( r ); cellH = tileset.height( r ); vertices = new float[16]; updated = new Rect(); }
public Tilemap( Object tx, TextureFilm tileset ) { super( 0, 0, 0, 0 ); this.texture = TextureCache.get( tx ); this.tileset = tileset; RectF r = tileset.get( 0 ); cellW = tileset.width( r ); cellH = tileset.height( r ); vertices = new float[16]; updated = new Rect(); }
public Tilemap( Object tx, TextureFilm tileset ) { super( 0, 0, 0, 0 ); this.texture = TextureCache.get( tx ); this.tileset = tileset; RectF r = tileset.get( 0 ); cellW = tileset.width( r ); cellH = tileset.height( r ); vertices = new float[16]; updated = new Rect(); }
@Override public Emitter emitter() { if (seal == null) return super.emitter(); Emitter emitter = new Emitter(); emitter.pos(ItemSpriteSheet.film.width(image)/2f + 2f, ItemSpriteSheet.film.height(image)/3f); emitter.fillTarget = false; emitter.pour(Speck.factory( Speck.RED_LIGHT ), 0.6f); return emitter; }
public TextureFilm( TextureFilm atlas, Object key, int width, int height ) { texture = atlas.texture; texWidth = atlas.texWidth; texHeight = atlas.texHeight; RectF patch = atlas.get( key ); float uw = (float)width / texWidth; float vh = (float)height / texHeight; int cols = (int)(width( patch ) / width); int rows = (int)(height( patch ) / 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 ); rect.shift( patch.left, patch.top ); add( i * cols + j, rect ); } } }
public TextureFilm( TextureFilm atlas, Object key, int width, int height ) { texture = atlas.texture; texWidth = atlas.texWidth; texHeight = atlas.texHeight; RectF patch = atlas.get( key ); float uw = (float)width / texWidth; float vh = (float)height / texHeight; int cols = (int)(width( patch ) / width); int rows = (int)(height( patch ) / 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 ); rect.shift( patch.left, patch.top ); add( i * cols + j, rect ); } } }
@Override public Emitter emitter() { if (seal == null) return super.emitter(); Emitter emitter = new Emitter(); emitter.pos(ItemSpriteSheet.film.width(image)/2f + 2f, ItemSpriteSheet.film.height(image)/3f); emitter.fillTarget = false; emitter.pour(Speck.factory( Speck.RED_LIGHT ), 0.6f); return emitter; }