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


Java TextureFilter类代码示例

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


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

示例1: create

import com.badlogic.gdx.graphics.Texture.TextureFilter; //导入依赖的package包/类
public void create () {
	batch = new SpriteBatch();
	sceneMatrix = new Matrix4().setToOrtho2D(0, 0, 480, 320);
	textMatrix = new Matrix4().setToOrtho2D(0, 0, 480, 320);

	atlas = new TextureAtlas(Gdx.files.internal("data/issue_pack"), Gdx.files.internal("data/"));
	texture = new Texture(Gdx.files.internal("data/resource1.jpg"), true);
	texture.setFilter(TextureFilter.MipMap, TextureFilter.Nearest);
	setTextureFilter(0);
	setModeString();

	sprite = atlas.createSprite("map");
	sprite2 = new Sprite(texture, 0, 0, 855, 480);
	font = new BitmapFont(Gdx.files.internal("data/font.fnt"), Gdx.files.internal("data/font.png"), false);

	Gdx.input.setInputProcessor(new InputAdapter() {
		public boolean touchDown (int x, int y, int pointer, int newParam) {
			mode++;
			if (mode == filters.length * 2) mode = 0;
			setTextureFilter(mode / 2);
			setModeString();
			return false;
		}
	});
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:26,代码来源:FilterPerformanceTest.java

示例2: Wave

import com.badlogic.gdx.graphics.Texture.TextureFilter; //导入依赖的package包/类
/**
    * @param hitPoint
    * @param bonus
    * @param speed
    * @param numberOfMonster
    * @param timeToRelease
    */
   public Wave(IGameService service, int index) {
super(service);
this.index = index;
texture= GameAsset.monsterTexture[index];
texture.setFilter(TextureFilter.Linear, TextureFilter.Linear);
ended = false;
action = new BaseLoopingAction(GameSpecs.numberOfMonster[index], GameSpecs.timeToRelease[index]) {
    
    @Override
    public void onActionRemove() {
	ended = true;
    }
    
    @Override
    public void onActionPerformance() {
	createMonster();
    }
};
   }
 
开发者ID:game-libgdx-unity,项目名称:GDX-Engine,代码行数:27,代码来源:Wave.java

示例3: create

import com.badlogic.gdx.graphics.Texture.TextureFilter; //导入依赖的package包/类
@Override
public void create() {		
	float w = Gdx.graphics.getWidth();
	float h = Gdx.graphics.getHeight();
	
	camera = new OrthographicCamera(1, h/w);
	batch = new SpriteBatch();
	
	texture = new Texture(Gdx.files.internal("data/libgdx.png"));
	texture.setFilter(TextureFilter.Linear, TextureFilter.Linear);
	
	TextureRegion region = new TextureRegion(texture, 0, 0, 200, 200);
	
	sprite = new Sprite(region);
	sprite.setSize(1f,  sprite.getHeight() / sprite.getWidth());
	sprite.setOrigin(sprite.getWidth()/2, sprite.getHeight()/2);
	sprite.setPosition(-.5f, -.5f);

}
 
开发者ID:game-libgdx-unity,项目名称:GDX-Engine,代码行数:20,代码来源:MyGdxGame.java

示例4: initUtils

import com.badlogic.gdx.graphics.Texture.TextureFilter; //导入依赖的package包/类
private void initUtils() {
    //init camera & viewport
    camera = new OrthographicCamera();
    viewport = new StretchViewport(Polymorph.WORLD_WIDTH, Polymorph.WORLD_HEIGHT, camera);
    viewport.apply(true);
    camera.update();

    //init sprite batch
    batch = new SpriteBatch();
    batch.setProjectionMatrix(camera.combined);

    //init font
    FreeTypeFontGenerator fontGenerator = polymorph.getAssetManager().get(Polymorph.FONT_BOLD_PATH, FreeTypeFontGenerator.class);
    FreeTypeFontParameter fontSettings = new FreeTypeFontParameter();
    fontSettings.size = 80;
    fontSettings.minFilter = TextureFilter.Linear;
    fontSettings.magFilter = TextureFilter.Linear;
    font = fontGenerator.generateFont(fontSettings);
}
 
开发者ID:DurianHLN,项目名称:Polymorph,代码行数:20,代码来源:GameScreen.java

示例5: addTexture

import com.badlogic.gdx.graphics.Texture.TextureFilter; //导入依赖的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

示例6: Renderer

import com.badlogic.gdx.graphics.Texture.TextureFilter; //导入依赖的package包/类
public Renderer () {
	try {
		lights = new Environment();
		lights.add(new DirectionalLight().set(Color.WHITE, new Vector3(-1, -0.5f, 0).nor()));

		spriteBatch = new SpriteBatch();
		modelBatch = new ModelBatch();

		backgroundTexture = new Texture(Gdx.files.internal("data/planet.jpg"), Format.RGB565, true);
		backgroundTexture.setFilter(TextureFilter.MipMap, TextureFilter.Linear);

		font = new BitmapFont(Gdx.files.internal("data/font10.fnt"), Gdx.files.internal("data/font10.png"), false);

		camera = new PerspectiveCamera(67, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
	} catch (Exception ex) {
		ex.printStackTrace();
	}
}
 
开发者ID:Motsai,项目名称:neblina-libgdx3d,代码行数:19,代码来源:Renderer.java

示例7: GameOver

import com.badlogic.gdx.graphics.Texture.TextureFilter; //导入依赖的package包/类
public GameOver (Invaders invaders) {
	super(invaders);
	spriteBatch = new SpriteBatch();
	background = new Texture(Gdx.files.internal("data/planet.jpg"));
	background.setFilter(TextureFilter.Linear, TextureFilter.Linear);

	logo = new Texture(Gdx.files.internal("data/title.png"));
	logo.setFilter(TextureFilter.Linear, TextureFilter.Linear);

	font = new BitmapFont(Gdx.files.internal("data/font16.fnt"), Gdx.files.internal("data/font16.png"), false);

	if (invaders.getController() != null) {
		invaders.getController().addListener(new ControllerAdapter() {
			@Override
			public boolean buttonUp(Controller controller,
					int buttonIndex) {
				controller.removeListener(this);
				isDone = true;
				return false;
			}
		});
	}
}
 
开发者ID:Motsai,项目名称:neblina-libgdx3d,代码行数:24,代码来源:GameOver.java

示例8: MainMenu

import com.badlogic.gdx.graphics.Texture.TextureFilter; //导入依赖的package包/类
public MainMenu (Invaders invaders) {
	super(invaders);

	spriteBatch = new SpriteBatch();
	background = new Texture(Gdx.files.internal("data/planet.jpg"));
	background.setFilter(TextureFilter.Linear, TextureFilter.Linear);

	logo = new Texture(Gdx.files.internal("data/title.png"));
	logo.setFilter(TextureFilter.Linear, TextureFilter.Linear);

	font = new BitmapFont(Gdx.files.internal("data/font16.fnt"), Gdx.files.internal("data/font16.png"), false);

	if (invaders.getController() != null) {
		invaders.getController().addListener(new ControllerAdapter() {
			@Override
			public boolean buttonUp(Controller controller, int buttonIndex) {
				controller.removeListener(this);
				isDone = true;
				return false;
			}
		});
	}
}
 
开发者ID:Motsai,项目名称:neblina-libgdx3d,代码行数:24,代码来源:MainMenu.java

示例9: write

import com.badlogic.gdx.graphics.Texture.TextureFilter; //导入依赖的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

示例10: LoadingScreen

import com.badlogic.gdx.graphics.Texture.TextureFilter; //导入依赖的package包/类
public LoadingScreen(TheEndlessCastle game)
{
	super(game);

	// We need to use raw path to assets and load it without assetsHandler as we are loading assets and reading ressources xml file
	Texture INSATexture = new Texture(Gdx.files.internal(_INSA_LOGO_TEXTURE_PATH), true);
	INSATexture.setFilter(TextureFilter.MipMapLinearLinear, TextureFilter.Linear);
	Texture OpenTexture = new Texture(Gdx.files.internal(_OPEN_LOGO_TEXTURE_PATH), true);
	OpenTexture.setFilter(TextureFilter.MipMapLinearLinear, TextureFilter.Linear);
	_INSALogoSprite = new Sprite(INSATexture);
	_mainLogoSprite = new Sprite(OpenTexture);
	_mainLogoSprite.setSize(9, 9f *_mainLogoSprite.getHeight()/_mainLogoSprite.getWidth());
	_INSALogoSprite.setSize(4, 4f *_INSALogoSprite.getHeight()/_INSALogoSprite.getWidth());
	_INSALogoSprite.setCenter(_camera.viewportWidth/2f, 1f);
	_mainLogoSprite.setCenter(_camera.viewportWidth/2f+1f, 9.5f);
}
 
开发者ID:mitsuhirato,项目名称:TheEndlessCastle,代码行数:17,代码来源:LoadingScreen.java

示例11: AbstractMenuScreen

import com.badlogic.gdx.graphics.Texture.TextureFilter; //导入依赖的package包/类
public <E extends Enum<?>> AbstractMenuScreen(Class<E> menuEnumClass, BitmapFont pFont, Class<?> selectorClass) {

		stage = new Stage();
		Gdx.input.setInputProcessor(stage);
		font = pFont != null ? pFont : new BitmapFont();
		font.getRegion().getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear);		
		font.setColor(0, 0, 0, 1);
		selectorHeight = font.getCapHeight();
		initItemsPositions(menuEnumClass);
		generateSelector(selectorClass);
		foregroundGroup= new Group();
		backgroundGroup = new Group();
		addBackgroundElements();
		foregroundGroup.addActor(selector);
		stage.addActor(backgroundGroup);
		stage.addActor(foregroundGroup);		
	}
 
开发者ID:provenza24,项目名称:Mario-Libgdx,代码行数:18,代码来源:AbstractMenuScreen.java

示例12: loadTitleTextures

import com.badlogic.gdx.graphics.Texture.TextureFilter; //导入依赖的package包/类
/**
 * Load the normal texture for this train. This will be used to display the train one the playing field.
 */
private void loadTitleTextures()
{
	try
	{
		TextureRegion texture = new TextureRegion(new Texture(Gdx.files.internal("textures/Trains_" + _modelName + ".png")));
		texture.flip(false, true);
		texture.getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear);
		_textures.put(_modelName, texture);
		
		Logger.__info("Succesfully loaded image for train " + _modelName + ".");
	}
	catch (GdxRuntimeException ex)
	{
		Logger.__error("Error while loading trains title image!", ex);
	}
}
 
开发者ID:hauke96,项目名称:METRO,代码行数:20,代码来源:TrainTemplate.java

示例13: loadModelTextures

import com.badlogic.gdx.graphics.Texture.TextureFilter; //导入依赖的package包/类
/**
 * Load the title image for this train that'll be displayed by the train buy dialog.
 */
private void loadModelTextures()
{
	Logger.__info("Loading train title image");
	try
	{
		FileHandle handle = Gdx.files.internal("textures/Trains_" + _modelName + "_big.png");
		Texture texture = new Texture(handle);
		TextureRegion textureRegion = new TextureRegion(texture);
		textureRegion.flip(false, true);
		textureRegion.getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear);
		_titleTextures.put(_modelName, textureRegion);
		
		Logger.__info("Succesfully loaded title image for train " + _modelName + ".");
	}
	catch (GdxRuntimeException ex)
	{
		Logger.__error("Error while loading title image!", ex);
	}
}
 
开发者ID:hauke96,项目名称:METRO,代码行数:23,代码来源:TrainTemplate.java

示例14: PowerLUT

import com.badlogic.gdx.graphics.Texture.TextureFilter; //导入依赖的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

示例15: show

import com.badlogic.gdx.graphics.Texture.TextureFilter; //导入依赖的package包/类
@Override
public void show() {
    iciclesViewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE);

    renderer = new ShapeRenderer();
    renderer.setAutoShapeType(true);

    // TODO: Initialize the HUD viewport
    hudViewport = new ScreenViewport();

    // TODO: Initialize the SpriteBatch
    batch = new SpriteBatch();

    // TODO: Initialize the BitmapFont
    font = new BitmapFont();

    // TODO: Give the font a linear TextureFilter
    font.getRegion().getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear);

    player = new Player(iciclesViewport);
    icicles = new Icicles(iciclesViewport);

    // TODO: Set top score to zero
    topScore = 0;
}
 
开发者ID:udacity,项目名称:ud405,代码行数:26,代码来源:IciclesScreen.java


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