本文整理汇总了Java中com.watabou.gltextures.SmartTexture类的典型用法代码示例。如果您正苦于以下问题:Java SmartTexture类的具体用法?Java SmartTexture怎么用?Java SmartTexture使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SmartTexture类属于com.watabou.gltextures包,在下文中一共展示了SmartTexture类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Halo
import com.watabou.gltextures.SmartTexture; //导入依赖的package包/类
public Halo() {
super();
if (!TextureCache.contains(CACHE_KEY)) {
Bitmap bmp = Bitmap.createBitmap(RADIUS * 2, RADIUS * 2,
Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bmp);
Paint paint = new Paint();
paint.setColor(0xFFFFFFFF);
canvas.drawCircle(RADIUS, RADIUS, RADIUS * 0.75f, paint);
paint.setColor(0x88FFFFFF);
canvas.drawCircle(RADIUS, RADIUS, RADIUS, paint);
TextureCache.add(CACHE_KEY, new SmartTexture(bmp));
}
texture(CACHE_KEY);
}
示例2: TextureFilm
import com.watabou.gltextures.SmartTexture; //导入依赖的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);
}
}
}
示例3: Font
import com.watabou.gltextures.SmartTexture; //导入依赖的package包/类
public Font( SmartTexture tx, int width, int height, String chars ) {
super( tx );
texture = tx;
int length = chars.length();
float uw = (float)width / tx.width;
float vh = (float)height / tx.height;
float left = 0;
float top = 0;
float bottom = vh;
for (int i=0; i < length; i++) {
RectF rect = new RectF( left, top, left += uw, bottom );
add( chars.charAt( i ), rect );
if (left >= 1) {
left = 0;
top = bottom;
bottom += vh;
}
}
lineHeight = baseLine = height;
}
示例4: TextureFilm
import com.watabou.gltextures.SmartTexture; //导入依赖的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: Halo
import com.watabou.gltextures.SmartTexture; //导入依赖的package包/类
public Halo() {
super();
if (!TextureCache.contains( CACHE_KEY )) {
Bitmap bmp = Bitmap.createBitmap( RADIUS * 2, RADIUS * 2, Bitmap.Config.ARGB_8888 );
Canvas canvas = new Canvas( bmp );
Paint paint = new Paint();
paint.setColor( 0xFFFFFFFF );
canvas.drawCircle( RADIUS, RADIUS, RADIUS * 0.75f, paint );
paint.setColor( 0x88FFFFFF );
canvas.drawCircle( RADIUS, RADIUS, RADIUS, paint );
TextureCache.add( CACHE_KEY, new SmartTexture( bmp ) );
}
texture( CACHE_KEY );
}
示例6: Halo
import com.watabou.gltextures.SmartTexture; //导入依赖的package包/类
public Halo() {
super();
if (!TextureCache.contains( CACHE_KEY )) {
Pixmap pixmap = new Pixmap(RADIUS * 2, RADIUS * 2, Pixmap.Format.RGBA8888);
pixmap.setColor( 0xFFFFFFFF );
pixmap.fillCircle( RADIUS, RADIUS, (int) (RADIUS * 0.75f));
pixmap.setColor( 0xFFFFFF88 );
pixmap.fillCircle( RADIUS, RADIUS, RADIUS );
GdxTexture bmp = new GdxTexture(pixmap);
TextureCache.add( CACHE_KEY, new SmartTexture( bmp ) );
}
texture( CACHE_KEY );
origin.set( RADIUS );
}
示例7: Halo
import com.watabou.gltextures.SmartTexture; //导入依赖的package包/类
public Halo() {
super();
if (!TextureCache.contains( CACHE_KEY )) {
Bitmap bmp = Bitmap.createBitmap( RADIUS * 2, RADIUS * 2, Bitmap.Config.ARGB_8888 );
Canvas canvas = new Canvas( bmp );
Paint paint = new Paint();
paint.setColor( 0xFFFFFFFF );
canvas.drawCircle( RADIUS, RADIUS, RADIUS * 0.75f, paint );
paint.setColor( 0x88FFFFFF );
canvas.drawCircle( RADIUS, RADIUS, RADIUS, paint );
TextureCache.add( CACHE_KEY, new SmartTexture( bmp ) );
}
texture( CACHE_KEY );
origin.set( RADIUS );
}
示例8: TextureFilm
import com.watabou.gltextures.SmartTexture; //导入依赖的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);
}
}
}
示例9: Halo
import com.watabou.gltextures.SmartTexture; //导入依赖的package包/类
public Halo() {
super();
if (!TextureCache.contains(CACHE_KEY)) {
Pixmap pixmap = new Pixmap(RADIUS * 2, RADIUS * 2, Pixmap.Format.RGBA8888);
pixmap.setColor(0xFFFFFFFF);
pixmap.fillCircle(RADIUS, RADIUS, (int) (RADIUS * 0.75f));
pixmap.setColor(0xFFFFFF88);
pixmap.fillCircle(RADIUS, RADIUS, RADIUS);
Bitmap bmp = new Bitmap(pixmap);
TextureCache.add(CACHE_KEY, new SmartTexture(bmp));
}
texture(CACHE_KEY);
origin.set(RADIUS);
}
示例10: Halo
import com.watabou.gltextures.SmartTexture; //导入依赖的package包/类
public Halo() {
super();
if (!TextureCache.contains( CACHE_KEY )) {
Bitmap bmp = Bitmap.createBitmap( RADIUS * 2, RADIUS * 2, Bitmap.Config.ARGB_8888 );
Canvas canvas = new Canvas( bmp );
Paint paint = new Paint();
paint.setColor( 0x0AFFFFFF );
for (int i = 0; i < 50; i++) {
canvas.drawCircle(RADIUS, RADIUS, RADIUS * (i+1)/50f, paint);
}
TextureCache.add( CACHE_KEY, new SmartTexture( bmp ) );
}
texture( CACHE_KEY );
}
示例11: Halo
import com.watabou.gltextures.SmartTexture; //导入依赖的package包/类
public Halo() {
if (!TextureCache.contains( CACHE_KEY )) {
Bitmap bmp = Bitmap.createBitmap( RADIUS * 2, RADIUS * 2, Bitmap.Config.ARGB_8888 );
Canvas canvas = new Canvas( bmp );
Paint paint = new Paint();
paint.setColor( 0xFFFFFFFF );
canvas.drawCircle( RADIUS, RADIUS, RADIUS * 0.75f, paint );
paint.setColor( 0x88FFFFFF );
canvas.drawCircle( RADIUS, RADIUS, RADIUS, paint );
TextureCache.add( CACHE_KEY, new SmartTexture( bmp ) );
}
texture( CACHE_KEY );
origin.set( RADIUS );
}
示例12: Font
import com.watabou.gltextures.SmartTexture; //导入依赖的package包/类
public Font(SmartTexture tx, int width, int height, String chars) {
super(tx);
texture = tx;
autoUppercase = chars.equals(LATIN_UPPER);
int length = chars.length();
float uw = (float) width / tx.width;
float vh = (float) height / tx.height;
float left = 0;
float top = 0;
float bottom = vh;
for (int i = 0; i < length; i++) {
RectF rect = new RectF(left, top, left += uw, bottom);
add(chars.charAt(i), rect);
if (left >= 1) {
left = 0;
top = bottom;
bottom += vh;
}
}
lineHeight = baseLine = height;
}
示例13: ShadowBox
import com.watabou.gltextures.SmartTexture; //导入依赖的package包/类
public ShadowBox() {
super( Assets.SHADOW, 1 );
//If this is the first time the texture is generated, set the filtering
if (texture.id == -1)
texture.filter( SmartTexture.LINEAR, SmartTexture.LINEAR );
scale.set( SIZE, SIZE );
}
示例14: Font
import com.watabou.gltextures.SmartTexture; //导入依赖的package包/类
public Font(SmartTexture tx, int width, int height, String chars)
{
super(tx);
texture = tx;
autoUppercase = chars.equals(LATIN_UPPER);
int length = chars.length();
float uw = (float) width / tx.width;
float vh = (float) height / tx.height;
float left = 0;
float top = 0;
float bottom = vh;
for (int i = 0; i < length; i++)
{
RectF rect = new RectF(left, top, left += uw, bottom);
add(chars.charAt(i), rect);
if (left >= 1)
{
left = 0;
top = bottom;
bottom += vh;
}
}
lineHeight = baseLine = height;
}
示例15: tiers
import com.watabou.gltextures.SmartTexture; //导入依赖的package包/类
public static TextureFilm tiers() {
if (tiers == null) {
SmartTexture texture = TextureCache.get( Assets.BRIGAND );
tiers = new TextureFilm( texture, texture.width, FRAME_HEIGHT );
}
return tiers;
}