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


Java Texture类代码示例

本文整理汇总了Java中com.watabou.glwrap.Texture的典型用法代码示例。如果您正苦于以下问题:Java Texture类的具体用法?Java Texture怎么用?Java Texture使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Texture类属于com.watabou.glwrap包,在下文中一共展示了Texture类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: update

import com.watabou.glwrap.Texture; //导入依赖的package包/类
public void update(){
	bind();
	filter( Texture.LINEAR, Texture.LINEAR );
	wrap( Texture.CLAMP, Texture.CLAMP);
	pixels.position(0);
	GLES20.glTexImage2D(
			GLES20.GL_TEXTURE_2D,
			0,
			GLES20.GL_RGBA,
			width,
			height,
			0,
			GLES20.GL_RGBA,
			GLES20.GL_UNSIGNED_BYTE,
			pixels );
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:17,代码来源:FogOfWar.java

示例2: update

import com.watabou.glwrap.Texture; //导入依赖的package包/类
public void update(){
	bind();
	filter( Texture.LINEAR, Texture.LINEAR );
	wrap( Texture.CLAMP, Texture.CLAMP);
	pixels.position(0);
	Gdx.gl.glTexImage2D(
			GL20.GL_TEXTURE_2D,
			0,
			GL20.GL_RGBA,
			width,
			height,
			0,
			GL20.GL_RGBA,
			GL20.GL_UNSIGNED_BYTE,
			pixels );
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon-gdx,代码行数:17,代码来源:FogOfWar.java

示例3: update

import com.watabou.glwrap.Texture; //导入依赖的package包/类
public void update(){
	bind();
	filter( Texture.LINEAR, Texture.LINEAR );
	pixels.position(0);
	GLES20.glTexImage2D(
			GLES20.GL_TEXTURE_2D,
			0,
			GLES20.GL_RGBA,
			width,
			height,
			0,
			GLES20.GL_RGBA,
			GLES20.GL_UNSIGNED_BYTE,
			pixels );
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:16,代码来源:FogOfWar.java

示例4: ShadowBox

import com.watabou.glwrap.Texture; //导入依赖的package包/类
public ShadowBox() {
	super(Assets.SHADOW, 1);

	if (texture.id == -1)
		texture.filter(Texture.LINEAR, Texture.LINEAR);

	scale.set(SIZE, SIZE);
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:9,代码来源:ShadowBox.java

示例5: clear

import com.watabou.glwrap.Texture; //导入依赖的package包/类
public static void clear() {

		for (Texture txt : all.values()) {
			txt.delete();
		}
		all.clear();

	}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:9,代码来源:TextureCache.java

示例6: clear

import com.watabou.glwrap.Texture; //导入依赖的package包/类
public static void clear() {
	
	for (Texture txt:all.values()) {
		txt.delete();
	}
	all.clear();
	
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:9,代码来源:TextureCache.java

示例7: clear

import com.watabou.glwrap.Texture; //导入依赖的package包/类
public static void clear() {

        for (Texture txt : all.values()) {
            txt.delete();
        }
        all.clear();

    }
 
开发者ID:skynet67,项目名称:pixel-dungeon-rebirth,代码行数:9,代码来源:TextureCache.java

示例8: draw

import com.watabou.glwrap.Texture; //导入依赖的package包/类
@Override
public void draw() {

	super.draw();

	NoosaScript script = NoosaScript.get();

	for (Texture img : mLayers) {
		img.bind();
		script.drawQuad(verticesBuffer);
	}
}
 
开发者ID:NYRDS,项目名称:pixel-dungeon-remix,代码行数:13,代码来源:CompositeTextureImage.java

示例9: addLayer

import com.watabou.glwrap.Texture; //导入依赖的package包/类
protected void addLayer(String id, Texture img) {
	if (mLayers == null) {
		mLayers = new ArrayList<>();
	}

	LayerDesc layerDesc = new LayerDesc(id, img);
	mLayers.add(layerDesc);
}
 
开发者ID:NYRDS,项目名称:pixel-dungeon-remix,代码行数:9,代码来源:CompositeMovieClip.java

示例10: setLayerTexture

import com.watabou.glwrap.Texture; //导入依赖的package包/类
public void setLayerTexture(String id, Texture img) {
	if (mLayers != null) {
		for (LayerDesc layer : mLayers) {
			if (layer.id.equals(id)) {
				layer.texture = img;
			}
		}
	}
}
 
开发者ID:NYRDS,项目名称:pixel-dungeon-remix,代码行数:10,代码来源:CompositeMovieClip.java

示例11: getLayerTexture

import com.watabou.glwrap.Texture; //导入依赖的package包/类
protected Texture getLayerTexture(String id) {
	if(mLayers!=null) {
		for (LayerDesc layer : mLayers) {
			if (layer.id.equals(id)) {
				return layer.texture;
			}
		}
	}
	return null;
}
 
开发者ID:NYRDS,项目名称:pixel-dungeon-remix,代码行数:11,代码来源:CompositeMovieClip.java

示例12: createGradient

import com.watabou.glwrap.Texture; //导入依赖的package包/类
public static SmartTexture createGradient(int... colors) {

		final String key = "" + colors;

		if (all.containsKey(key)) {

			return all.get(key);

		} else {

			Bitmap bmp = Bitmap.createBitmap(colors.length, 1, Bitmap.Config.ARGB_8888);
			for (int i = 0; i < colors.length; i++) {
				bmp.setPixel(i, 0, colors[i]);
			}
			SmartTexture tx = new SmartTexture(bmp);

			tx.filter(Texture.LINEAR, Texture.LINEAR);
			tx.wrap(Texture.CLAMP, Texture.CLAMP);

			all.put(key, tx);
			return tx;
		}

	}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:25,代码来源:TextureCache.java

示例13: createGradient

import com.watabou.glwrap.Texture; //导入依赖的package包/类
public static SmartTexture createGradient( int... colors ) {
	
	final String key = "" + colors;
	
	if (all.containsKey( key )) {
		
		return all.get( key );
		
	} else {
	
		Bitmap bmp = Bitmap.createBitmap( colors.length, 1, Bitmap.Config.ARGB_8888 );
		for (int i=0; i < colors.length; i++) {
			bmp.setPixel( i, 0, colors[i] );
		}
		SmartTexture tx = new SmartTexture( bmp );

		tx.filter( Texture.LINEAR, Texture.LINEAR );
		tx.wrap( Texture.CLAMP, Texture.CLAMP );

		all.put( key, tx );
		return tx;
	}
	
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:25,代码来源:TextureCache.java

示例14: create

import com.watabou.glwrap.Texture; //导入依赖的package包/类
@Override
public void create() {

	super.create();

	GameScene.scene = null;

	float minWidth, minHeight;
	if (UNISTPixelDungeon.landscape()) {
		minWidth = MIN_WIDTH_L;
		minHeight = MIN_HEIGHT_L;
	} else {
		minWidth = MIN_WIDTH_P;
		minHeight = MIN_HEIGHT_P;
	}

	maxDefaultZoom = (int)Math.min(Game.width/minWidth, Game.height/minHeight);
	maxScreenZoom = (int)Math.min(Game.dispWidth/minWidth, Game.dispHeight/minHeight);
	defaultZoom = UNISTPixelDungeon.scale();

	if (defaultZoom < Math.ceil( Game.density * 2 ) || defaultZoom > maxDefaultZoom){
		defaultZoom = (int)Math.ceil( Game.density * 2.5 );
		while ((
			Game.width / defaultZoom < minWidth ||
			Game.height / defaultZoom < minHeight
		) && defaultZoom > 1) {
			defaultZoom--;
		}
	}

	minZoom = 1;
	maxZoom = defaultZoom * 2;

	Camera.reset( new PixelCamera( defaultZoom ) );

	float uiZoom = defaultZoom;
	uiCamera = Camera.createFullscreen( uiZoom );
	Camera.add( uiCamera );

	if (pixelFont == null) {

		// 3x5 (6)
		pixelFont = Font.colorMarked(
			BitmapCache.get( Assets.PIXELFONT), 0x00000000, BitmapText.Font.LATIN_FULL );
		pixelFont.baseLine = 6;
		pixelFont.tracking = -1;

		// 9x15 (18)
		font1x = Font.colorMarked(
				BitmapCache.get( Assets.FONT1X), 22, 0x00000000, BitmapText.Font.LATIN_FULL );
		font1x.baseLine = 17;
		font1x.tracking = -2;
		font1x.texture.filter(Texture.LINEAR, Texture.LINEAR);

		//font1x double scaled
		font2x = Font.colorMarked(
				BitmapCache.get( Assets.FONT2X), 44, 0x00000000, BitmapText.Font.LATIN_FULL );
		font2x.baseLine = 38;
		font2x.tracking = -4;
		font2x.texture.filter(Texture.LINEAR, Texture.NEAREST);
	}
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:63,代码来源:PixelScene.java

示例15: FogTexture

import com.watabou.glwrap.Texture; //导入依赖的package包/类
public FogTexture() {
	super( Bitmap.createBitmap( width2, height2, Bitmap.Config.ARGB_8888 ) );
	filter( Texture.LINEAR, Texture.LINEAR );
	TextureCache.add( FogOfWar.class, this );
}
 
开发者ID:ConsideredHamster,项目名称:YetAnotherPixelDungeon,代码行数:6,代码来源:FogOfWar.java


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