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


Java TextureWrap类代码示例

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


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

示例1: addTexture

import com.badlogic.gdx.graphics.Texture.TextureWrap; //导入依赖的package包/类
public void addTexture(String file) {
		Texture texture = new Texture(Gdx.files.internal(file), true);
		
		texture.setWrap(TextureWrap.Repeat, TextureWrap.Repeat);
		if(ExterminateGame.useGL3) {
			texture.setFilter(TextureFilter.MipMapLinearLinear, TextureFilter.Linear);
		}
		else {
			texture.setFilter(TextureFilter.MipMapLinearNearest, TextureFilter.Linear);				
		}
		
		if(ltid==0) {
			textureHerbe = texture;
		}
		else if(ltid==1) {
			textureSand = texture;
		}
		else if(ltid==2) {
			textureDirt = texture;
		}
		else if(ltid==3) {
			textureRock = texture;
		}

	ltid++;
}
 
开发者ID:Osaris31,项目名称:exterminate,代码行数:27,代码来源:Biome.java

示例2: write

import com.badlogic.gdx.graphics.Texture.TextureWrap; //导入依赖的package包/类
@Override
public void write (Json json) {
	super.write(json);
	json.writeValue("width", width);
	json.writeValue("height", height);
	json.writeValue("texture", texturePath);
	if (regionName != null)
		json.writeValue(regionName);
	json.writeValue("srcX", srcX);
	json.writeValue("srcY", srcY);
	json.writeValue("srcWidth", srcWidth);
	json.writeValue("srcHeight", srcHeight);
	json.writeValue("originX", originX);
	json.writeValue("originY", originY);
	json.writeValue("minFilter", minFilter == TextureFilter.Linear ? "Linear" : "Nearest");
	json.writeValue("magFilter", magFilter == TextureFilter.Linear ? "Linear" : "Nearest");
	JsonUtil.writeColorToJson(json, color, "tint");
	json.writeValue("uWrap",
		uWrap == TextureWrap.ClampToEdge ? "ClampToEdge" : uWrap == TextureWrap.Repeat ? "Repeat" : "MirroredRepeat");
	json.writeValue("vWrap",
		vWrap == TextureWrap.ClampToEdge ? "ClampToEdge" : vWrap == TextureWrap.Repeat ? "Repeat" : "MirroredRepeat");
}
 
开发者ID:Quexten,项目名称:RavTech,代码行数:23,代码来源:SpriteRenderer.java

示例3: PowerLUT

import com.badlogic.gdx.graphics.Texture.TextureWrap; //导入依赖的package包/类
/** W power will be in luminance, and H power will be in alpha**/
public PowerLUT(float powerW, float intensityW, float powerH, float intensityH, int width, int height){

	Pixmap pixmap = new Pixmap(width, height, Format.RGBA8888);
	for (int i=0; i<width; i++){
		float valueW = (float)Math.pow((float)i/width, powerW) * intensityW;
           for (int j = 0; j < height; j++) {
               float valueH = (float)Math.pow((float)j/height, powerH) * intensityH;
               pixmap.setColor(valueW, valueH, 1.0f, 1.0f);
               pixmap.drawPixel(i, j);
           }
	}
	
	PixmapTextureData data = new PixmapTextureData(pixmap, Format.RGBA8888, false, false, true);
	
	texture = new Texture(data);
	texture.setWrap(TextureWrap.ClampToEdge, TextureWrap.ClampToEdge);
	texture.setFilter(TextureFilter.Linear, TextureFilter.Linear);
}
 
开发者ID:CypherCove,项目名称:DoubleHelix,代码行数:20,代码来源:PowerLUT.java

示例4: OrthogonalTiledMapRendererWithObjects

import com.badlogic.gdx.graphics.Texture.TextureWrap; //导入依赖的package包/类
public OrthogonalTiledMapRendererWithObjects(TiledMap map) {
    super(map);
    
    
    this.occlusionFbo = new FrameBuffer(Format.RGBA8888, Gdx.graphics.getWidth() / 2, Gdx.graphics.getHeight() / 2, false);
    this.shadowmapFbo = new FrameBuffer(Format.RGBA8888, Gdx.graphics.getWidth() / 2, 1, false);
    
    this.shadowmapTex = shadowmapFbo.getColorBufferTexture();
    this.shadowmapTex.setFilter(TextureFilter.Linear, TextureFilter.Linear);
    this.shadowmapTex.setWrap(TextureWrap.Repeat, TextureWrap.Repeat);
    
    //this.orthoCam = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
    //this.orthoCam.setToOrtho(Y_DOWN);
    
    this.lights = new ArrayList<Light>();
    this.mouseLight = new Light(0, 0, Color.WHITE);
}
 
开发者ID:kibertoad,项目名称:swampmachine,代码行数:18,代码来源:OrthogonalTiledMapRendererWithObjects.java

示例5: SpriteManager

import com.badlogic.gdx.graphics.Texture.TextureWrap; //导入依赖的package包/类
public SpriteManager(CrazyDriver game){
	//poner donde empieza el coche en 150 x y en 0 y
	car = new Car(ResourceManager.getAtlas("imagenes")
			   .findRegion("car_up"), 150, 0);
	//instancia los arrays de amigos y enemigos	
	enemies=new Array<Enemy>();
	friends=new Array<Friend>();
	objetos=new Array<Objetos>();
	//esto es para que el fondo de mueva
	texture = new Texture(Gdx.files.internal("suelo/tunnel_road.jpg"));
	texture.setWrap(TextureWrap.Repeat,TextureWrap.Repeat);
	sprite = new Sprite(texture, 0, 0, 512, 512);
	//genero aleatoriamente peatones
	//generarPersonas();
	generarObjetos();
	this.game = game;

}
 
开发者ID:Alariel91,项目名称:Crazy-Driver-VideoGame,代码行数:19,代码来源:SpriteManager.java

示例6: PostProcessor

import com.badlogic.gdx.graphics.Texture.TextureWrap; //导入依赖的package包/类
public PostProcessor( int fboWidth, int fboHeight, boolean useDepth, boolean useAlphaChannel, boolean use32Bits,
		TextureWrap u, TextureWrap v ) {
	if( use32Bits ) {
		if( useAlphaChannel ) {
			fbFormat = Format.RGBA8888;
		} else {
			fbFormat = Format.RGB888;
		}
	} else {
		if( useAlphaChannel ) {
			fbFormat = Format.RGBA4444;
		} else {
			fbFormat = Format.RGB565;
		}
	}

	composite = newPingPongBuffer( fboWidth, fboHeight, fbFormat, useDepth );
	setBufferTextureWrap( u, v );

	pipelineState = new PipelineState();

	capturing = false;
	hasCaptured = false;
	enabled = true;
	this.useDepth = useDepth;
}
 
开发者ID:matheus23,项目名称:RuinsOfRevenge,代码行数:27,代码来源:PostProcessor.java

示例7: b

import com.badlogic.gdx.graphics.Texture.TextureWrap; //导入依赖的package包/类
public static void b()
{
  try
  {
    aj.a("PlayerCompassVisuals.createResources");
    boolean bool = f.b();
    if (!bool)
      return;
    c.a("CreateXmpRingMesh", c.e("scanner/emp_ring.obj"), new bp());
    c.a("CreatePlayerCompassTexture", c.b("scanner/compass_ring.png", true), Texture.TextureFilter.MipMapNearestLinear, Texture.TextureFilter.Linear, Texture.TextureWrap.Repeat, Texture.TextureWrap.ClampToEdge, new bq());
    ad.a("CreatePlayerCompassShader", "attribute vec4 a_position;\nattribute vec2 a_texCoord0;\nuniform mat4 u_modelViewProject;\nuniform vec2 u_uvScale;\nuniform vec3 u_bearing;\nuniform vec2 u_bearingThreshold;\nuniform vec4 u_color;\nuniform vec4 u_bearingColor;\nvarying vec2 v_texCoord0;\nvarying vec4 v_bearingColor;\nvoid main() {\n   v_texCoord0 = u_uvScale * a_texCoord0;\n   vec3 normalizedPos = normalize(a_position.xyz);\n   float bearingDot = dot(normalizedPos, u_bearing);   float bearingStrength = (bearingDot - u_bearingThreshold.x) * u_bearingThreshold.y;   v_bearingColor = mix(u_color, u_bearingColor, clamp(bearingStrength, 0.0, 1.0));\n   gl_Position = u_modelViewProject * a_position;\n}\n", "#ifdef GL_ES\nprecision mediump float;\n#endif\nuniform sampler2D u_texture;\nvarying vec4 v_bearingColor;\nvarying vec2 v_texCoord0;\nvoid main() {\n  gl_FragColor = v_bearingColor + texture2D(u_texture, v_texCoord0);\n}\n", new br());
    f.c();
    return;
  }
  finally
  {
    aj.b();
  }
}
 
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:20,代码来源:bo.java

示例8: a

import com.badlogic.gdx.graphics.Texture.TextureWrap; //导入依赖的package包/类
public static void a(boolean paramBoolean)
{
  try
  {
    aj.a("InterferenceVisuals.createResources");
    boolean bool = i.a(paramBoolean);
    if (!bool)
      return;
    VertexAttribute[] arrayOfVertexAttribute = new VertexAttribute[1];
    arrayOfVertexAttribute[0] = new VertexAttribute(0, 2, "a_position");
    c.a("CreateInterferenceMesh", a.a(c, d, null, arrayOfVertexAttribute), new ax());
    c.a("CreateInterferenceTexture", c.b("scanner/zeroxm_static.png", false), Texture.TextureFilter.Linear, Texture.TextureFilter.Linear, Texture.TextureWrap.Repeat, Texture.TextureWrap.Repeat, new ay());
    c.a("CreateInterferenceNoiseTexture", c.b("scanner/zeroxm_static_noise.png", false), Texture.TextureFilter.Nearest, Texture.TextureFilter.Nearest, Texture.TextureWrap.Repeat, Texture.TextureWrap.Repeat, new az());
    ad.a("CreateInterferenceShader", "attribute vec2 a_position;\nuniform vec2 u_uvBias;\nvarying vec2 v_texCoord0;\nvarying vec2 v_texCoord1;\nvarying vec2 v_texCoord2;\nvoid main() {\n  v_texCoord0 = a_position.xy;\n  v_texCoord1 = u_uvBias + a_position.xy;\n  v_texCoord2 = u_uvBias - a_position.xy;\n  gl_Position = vec4(a_position.xy * 2.0 - 1.0, 1, 1);\n}\n", "#ifdef GL_ES\nprecision mediump float;\n#endif\nuniform sampler2D u_texture;\nuniform sampler2D u_textureNoise;\nuniform float u_rampTarget;\nuniform vec3 u_noiseColor;\nvarying vec2 v_texCoord0;\nvarying vec2 v_texCoord1;\nvarying vec2 v_texCoord2;\nvoid main() {\n  vec4 scans = texture2D(u_texture, v_texCoord0);\n  vec4 noise_down = texture2D(u_textureNoise, v_texCoord1);\n  vec4 noise_up = texture2D(u_textureNoise, v_texCoord2);\n  float flicker_alpha = abs(noise_down.a - u_rampTarget);  flicker_alpha = flicker_alpha < 0.15 ? 0.0 : flicker_alpha * 0.6;\n  gl_FragColor = vec4(mix(scans.aaa, noise_up.aaa, 0.5) * u_noiseColor, flicker_alpha);\n}\n", new ba());
    i.c();
    return;
  }
  finally
  {
    aj.b();
  }
}
 
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:23,代码来源:aw.java

示例9: BouncingBuffer

import com.badlogic.gdx.graphics.Texture.TextureWrap; //导入依赖的package包/类
public BouncingBuffer(Format format, int width, int height, boolean hasDepth) {
	buffer1 = new BouncyBuffer(format, width, height, hasDepth);
	buffer2 = new BouncyBuffer(format, width, height, hasDepth);
	current = buffer1;

	this.width = this.buffer1.getWidth();
	this.height = this.buffer1.getHeight();

	this.uWrap = TextureWrap.ClampToEdge;
	this.vWrap = TextureWrap.ClampToEdge;

	rebind();
}
 
开发者ID:spookygames,项目名称:gdx-gfx,代码行数:14,代码来源:BouncingBuffer.java

示例10: setTextureWrap

import com.badlogic.gdx.graphics.Texture.TextureWrap; //导入依赖的package包/类
public void setTextureWrap(TextureWrap u, TextureWrap v) {
	this.uWrap = u;
	this.vWrap = v;

	texture1.setWrap(u, v);
	texture2.setWrap(u, v);
}
 
开发者ID:spookygames,项目名称:gdx-gfx,代码行数:8,代码来源:BouncingBuffer.java

示例11: PostProcessor

import com.badlogic.gdx.graphics.Texture.TextureWrap; //导入依赖的package包/类
/** Construct a new PostProcessor with the given parameters and the specified texture wrap mode */
public PostProcessor (int fboWidth, int fboHeight, boolean useDepth, boolean fsaa, boolean useAlphaChannel, boolean use32Bits,
	TextureWrap u, TextureWrap v) {
	if (use32Bits) {
		if (useAlphaChannel) {
			fbFormat = Format.RGBA8888;
		} else {
			fbFormat = Format.RGB888;
		}
	} else {
		if (useAlphaChannel) {
			fbFormat = Format.RGBA4444;
		} else {
			fbFormat = Format.RGB565;
		}
	}

	composite = newPingPongBuffer(fboWidth, fboHeight, fbFormat, useDepth, fsaa);
	setBufferTextureWrap(u, v);

	pipelineState = new PipelineState();

	capturing = false;
	hasCaptured = false;
	enabled = true;
	this.useDepth = useDepth;
	if (useDepth) {
		clearBits |= GL20.GL_DEPTH_BUFFER_BIT;
	}

	setViewport(null);
}
 
开发者ID:Osaris31,项目名称:exterminate,代码行数:33,代码来源:PostProcessor.java

示例12: setBufferTextureWrap

import com.badlogic.gdx.graphics.Texture.TextureWrap; //导入依赖的package包/类
public void setBufferTextureWrap (TextureWrap u, TextureWrap v) {
	compositeWrapU = u;
	compositeWrapV = v;

	composite.texture1.setWrap(compositeWrapU, compositeWrapV);
	composite.texture2.setWrap(compositeWrapU, compositeWrapV);
}
 
开发者ID:Osaris31,项目名称:exterminate,代码行数:8,代码来源:PostProcessor.java

示例13: getRepeatValue

import com.badlogic.gdx.graphics.Texture.TextureWrap; //导入依赖的package包/类
private String getRepeatValue() {
    if (settings.wrapX == TextureWrap.Repeat && settings.wrapY == TextureWrap.Repeat)
        return "xy";
    if (settings.wrapX == TextureWrap.Repeat && settings.wrapY == TextureWrap.ClampToEdge)
        return "x";
    if (settings.wrapX == TextureWrap.ClampToEdge && settings.wrapY == TextureWrap.Repeat)
        return "y";
    return "none";
}
 
开发者ID:Longri,项目名称:cachebox3.0,代码行数:10,代码来源:TexturePacker_Base.java

示例14: read

import com.badlogic.gdx.graphics.Texture.TextureWrap; //导入依赖的package包/类
@Override
public void read (Json json, JsonValue jsonData) {
	super.read(json, jsonData);
	if (jsonData.has("width"))
		width = jsonData.getFloat("width");
	if (jsonData.has("height"))
		height = jsonData.getFloat("height");
	if (jsonData.has("texture"))
		texturePath = jsonData.getString("texture");
	if (jsonData.has("srcX")) {
		useCustomSrc = true;
		srcX = jsonData.getInt("srcX");
	}
	if (jsonData.has("srcY"))
		srcY = jsonData.getInt("srcY");
	if (jsonData.has("srcWidth"))
		srcWidth = jsonData.getInt("srcWidth");
	if (jsonData.has("srcHeight"))
		srcHeight = jsonData.getInt("srcHeight");
	if (jsonData.has("originX"))
		originX = jsonData.getFloat("originX");
	if (jsonData.has("originY"))
		originY = jsonData.getFloat("originY");
	if (jsonData.has("minFilter"))
		minFilter = jsonData.getString("minFilter").equals("Linear") ? TextureFilter.Linear : TextureFilter.Nearest;
	if (jsonData.has("magFilter"))
		magFilter = jsonData.getString("magFilter").equals("Linear") ? TextureFilter.Linear : TextureFilter.Nearest;
	if (jsonData.has("tint"))
		setColor(JsonUtil.readColorFromJson(jsonData, "tint"));
	if (jsonData.has("uWrap")) {
		String uWrapStrings = jsonData.getString("uWrap");
		uWrap = uWrapStrings.equals("ClampToEdge") ? TextureWrap.ClampToEdge
			: uWrapStrings.equals("Repeat") ? TextureWrap.Repeat : TextureWrap.MirroredRepeat;
	}
	if (jsonData.has("vWrap")) {
		String vWrapStrings = jsonData.getString("vWrap");
		vWrap = vWrapStrings.equals("ClampToEdge") ? TextureWrap.ClampToEdge
			: vWrapStrings.equals("Repeat") ? TextureWrap.Repeat : TextureWrap.MirroredRepeat;
	}
}
 
开发者ID:Quexten,项目名称:RavTech,代码行数:41,代码来源:SpriteRenderer.java

示例15: getLibGDXTextureWrap

import com.badlogic.gdx.graphics.Texture.TextureWrap; //导入依赖的package包/类
private TextureWrap getLibGDXTextureWrap( int glConst ) {
    for ( TextureWrap tw : TextureWrap.values() ) {
        if ( tw.getGLEnum() == glConst ) {
            return tw;
        }
    }
    
    return TextureWrap.Repeat;
}
 
开发者ID:Inari-Soft,项目名称:inari-firefly-libGDX,代码行数:10,代码来源:GdxGraphicsImpl.java


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