本文整理汇总了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 );
}
示例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 );
}
示例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 );
}
示例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);
}
示例5: clear
import com.watabou.glwrap.Texture; //导入依赖的package包/类
public static void clear() {
for (Texture txt : all.values()) {
txt.delete();
}
all.clear();
}
示例6: clear
import com.watabou.glwrap.Texture; //导入依赖的package包/类
public static void clear() {
for (Texture txt:all.values()) {
txt.delete();
}
all.clear();
}
示例7: clear
import com.watabou.glwrap.Texture; //导入依赖的package包/类
public static void clear() {
for (Texture txt : all.values()) {
txt.delete();
}
all.clear();
}
示例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);
}
}
示例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);
}
示例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;
}
}
}
}
示例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;
}
示例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;
}
}
示例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;
}
}
示例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);
}
}
示例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 );
}