com.badlogic.gdx.graphics.Texture.TextureFilter Java Examples
The following examples show how to use
com.badlogic.gdx.graphics.Texture.TextureFilter.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TextRenderer.java From bladecoder-adventure-engine with Apache License 2.0 | 6 votes |
@Override public void loadAssets() { FreeTypeFontLoaderParameter params = new FreeTypeFontLoaderParameter(); float scale = EngineAssetManager.getInstance().getScale(); params.fontFileName = EngineAssetManager.FONT_DIR + fontName + EngineAssetManager.FONT_EXT; params.fontParameters.size = (int) (fontSize * scale); params.fontParameters.borderWidth = (int) (borderWidth * scale); params.fontParameters.borderColor = borderColor; params.fontParameters.borderStraight = borderStraight; params.fontParameters.shadowOffsetX = (int) (shadowOffsetX * scale); params.fontParameters.shadowOffsetY = (int) (shadowOffsetY * scale); params.fontParameters.shadowColor = shadowColor; params.fontParameters.characters = ""; params.fontParameters.incremental = true; params.fontParameters.magFilter = TextureFilter.Linear; params.fontParameters.minFilter = TextureFilter.Linear; EngineAssetManager.getInstance().load(fontName + getFontSize() + EngineAssetManager.FONT_EXT, BitmapFont.class, params); }
Example #2
Source File: IciclesScreen.java From ud405 with MIT License | 6 votes |
@Override public void show() { iciclesViewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE); renderer = new ShapeRenderer(); renderer.setAutoShapeType(true); hudViewport = new ScreenViewport(); batch = new SpriteBatch(); font = new BitmapFont(); font.getRegion().getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear); player = new Player(iciclesViewport); // TODO: Initialize icicles with the difficulty icicles = new Icicles(iciclesViewport, difficulty); topScore = 0; }
Example #3
Source File: Art.java From uracer-kotd with Apache License 2.0 | 6 votes |
private static void loadCircleProgress () { texCircleProgress = Art.newTexture("data/base/progress/circle-progress-full.png", true); texCircleProgress.setFilter(TextureFilter.MipMapLinearNearest, TextureFilter.Linear); texCircleProgressHalf = Art.newTexture("data/base/progress/circle-progress-half.png", true); texCircleProgressHalf.setFilter(TextureFilter.MipMapLinearNearest, TextureFilter.Linear); texCircleProgressHalfMask = Art.newTexture("data/base/progress/circle-progress-half-mask.png", true); texCircleProgressHalfMask.setFilter(TextureFilter.MipMapLinearNearest, TextureFilter.Linear); texRadLinesProgress = Art.newTexture("data/base/progress/radlines-progress-full.png", true); texRadLinesProgress.setFilter(TextureFilter.MipMapLinearNearest, TextureFilter.Linear); texCircleProgressMask = Art.newTexture("data/base/progress/circle-progress-mask.png", true); texCircleProgressMask.setFilter(TextureFilter.MipMapLinearNearest, TextureFilter.Linear); }
Example #4
Source File: IciclesScreen.java From ud405 with MIT License | 6 votes |
@Override public void show() { iciclesViewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE); renderer = new ShapeRenderer(); renderer.setAutoShapeType(true); hudViewport = new ScreenViewport(); batch = new SpriteBatch(); font = new BitmapFont(); font.getRegion().getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear); player = new Player(iciclesViewport); icicles = new Icicles(iciclesViewport, difficulty); Gdx.input.setInputProcessor(this); topScore = 0; }
Example #5
Source File: IciclesScreen.java From ud405 with MIT License | 6 votes |
@Override public void show() { iciclesViewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE); renderer = new ShapeRenderer(); renderer.setAutoShapeType(true); hudViewport = new ScreenViewport(); batch = new SpriteBatch(); font = new BitmapFont(); font.getRegion().getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear); player = new Player(iciclesViewport); icicles = new Icicles(iciclesViewport, difficulty); Gdx.input.setInputProcessor(this); topScore = 0; }
Example #6
Source File: IciclesScreen.java From ud405 with MIT License | 6 votes |
@Override public void show() { iciclesViewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE); renderer = new ShapeRenderer(); renderer.setAutoShapeType(true); hudViewport = new ScreenViewport(); batch = new SpriteBatch(); font = new BitmapFont(); font.getRegion().getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear); player = new Player(iciclesViewport); icicles = new Icicles(iciclesViewport, difficulty); Gdx.input.setInputProcessor(this); topScore = 0; }
Example #7
Source File: IciclesScreen.java From ud405 with MIT License | 6 votes |
@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; }
Example #8
Source File: ImageRenderer.java From bladecoder-adventure-engine with Apache License 2.0 | 6 votes |
private void retrieveSource(String source) { CacheEntry entry = sourceCache.get(source); if (entry == null || entry.refCounter < 1) { loadSource(source); EngineAssetManager.getInstance().finishLoading(); entry = sourceCache.get(source); } if (((ImageCacheEntry) entry).tex == null) { // I18N for images if (source.charAt(0) == I18N.PREFIX) { source = getI18NSource(source.substring(1)); } ((ImageCacheEntry) entry).tex = EngineAssetManager.getInstance() .getTexture(EngineAssetManager.IMAGE_DIR + source); ((ImageCacheEntry) entry).tex.setFilter(TextureFilter.Linear, TextureFilter.Linear); } }
Example #9
Source File: IciclesScreen.java From ud405 with MIT License | 6 votes |
@Override public void show() { iciclesViewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE); renderer = new ShapeRenderer(); renderer.setAutoShapeType(true); hudViewport = new ScreenViewport(); batch = new SpriteBatch(); font = new BitmapFont(); font.getRegion().getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear); player = new Player(iciclesViewport); icicles = new Icicles(iciclesViewport, difficulty); Gdx.input.setInputProcessor(this); topScore = 0; }
Example #10
Source File: IciclesScreen.java From ud405 with MIT License | 6 votes |
@Override public void show() { iciclesViewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE); renderer = new ShapeRenderer(); renderer.setAutoShapeType(true); hudViewport = new ScreenViewport(); batch = new SpriteBatch(); font = new BitmapFont(); font.getRegion().getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear); player = new Player(iciclesViewport); // TODO: Initialize icicles with the difficulty icicles = new Icicles(iciclesViewport); topScore = 0; }
Example #11
Source File: GdxCanvas.java From seventh with GNU General Public License v2.0 | 6 votes |
/** * Retrieve the desired font and size (may load the font * if not cached). * * @param alias * @param size * @return the font */ private BitmapFont getFont(String alias, int size) { BitmapFont font = null; String mask = alias + ":" + size; if(this.fonts.containsKey(mask)) { font = this.fonts.get(mask); } else if(this.generators.containsKey(alias)) { FreeTypeFontParameter params = new FreeTypeFontParameter(); params.size = size; params.characters = FreeTypeFontGenerator.DEFAULT_CHARS; params.flip = true; params.magFilter = TextureFilter.Linear; params.minFilter = TextureFilter.Linear; font = this.generators.get(alias).generateFont(params); this.fonts.put(mask, font); } return font; }
Example #12
Source File: Renderer.java From buffer_bci with GNU General Public License v3.0 | 6 votes |
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(); } }
Example #13
Source File: GameOver.java From buffer_bci with GNU General Public License v3.0 | 6 votes |
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; } }); } }
Example #14
Source File: MainMenu.java From buffer_bci with GNU General Public License v3.0 | 6 votes |
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; } }); } }
Example #15
Source File: BubbleLevelScreen.java From ud405 with MIT License | 5 votes |
@Override public void show() { axisViewport = new FitViewport(WORLD_SIZE, WORLD_SIZE); renderer = new ShapeRenderer(); renderer.setAutoShapeType(true); batch = new SpriteBatch(); textViewport = new ScreenViewport(); font = new BitmapFont(); font.getData().setScale(TEXT_SCALE); font.getRegion().getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear); maxAcceleration = 0; minAcceleration = Float.MAX_VALUE; }
Example #16
Source File: HelpScreen.java From bladecoder-adventure-engine with Apache License 2.0 | 5 votes |
@Override public void show() { final Locale locale = ui.getWorld().getI18N().getCurrentLocale(); String filename = null; UIModes uiMode = UIModes.valueOf(Config.getInstance().getProperty(Config.UI_MODE, "TWO_BUTTONS").toUpperCase(Locale.ENGLISH)); if (Gdx.input.isPeripheralAvailable(Peripheral.MultitouchScreen) && uiMode == UIModes.TWO_BUTTONS) { uiMode = UIModes.PIE; } switch (uiMode) { case PIE: filename = PIE_FILENAME; break; case SINGLE_CLICK: filename = SINGLE_CLICK_FILENAME; break; case TWO_BUTTONS: filename = TWO_BUTTONS_FILENAME; break; } localeFilename = MessageFormat.format("{0}_{1}.png", filename, locale.getLanguage()); if (!EngineAssetManager.getInstance().assetExists(localeFilename)) localeFilename = MessageFormat.format("{0}.png", filename); tex = new Texture(EngineAssetManager.getInstance().getResAsset(localeFilename)); tex.setFilter(TextureFilter.Linear, TextureFilter.Linear); Gdx.input.setInputProcessor(inputProcessor); }
Example #17
Source File: CreditsScreen.java From bladecoder-adventure-engine with Apache License 2.0 | 5 votes |
private void retrieveAssets() { style = ui.getSkin().get(CreditScreenStyle.class); final Locale locale = Locale.getDefault(); String localeFilename = MessageFormat.format("{0}_{1}.txt", CREDITS_FILENAME, locale.getLanguage()); if (!EngineAssetManager.getInstance().assetExists(localeFilename)) localeFilename = MessageFormat.format("{0}.txt", CREDITS_FILENAME); BufferedReader reader = EngineAssetManager.getInstance().getAsset(localeFilename).reader(4096, "utf-8"); try { String line; while ((line = reader.readLine()) != null) { credits.add(line); } } catch (Exception e) { EngineLogger.error(e.getMessage()); ui.setCurrentScreen(Screens.MENU_SCREEN); } scrollY += style.titleFont.getLineHeight(); // Load IMAGES for (String s : credits) { if (s.indexOf('#') != -1 && s.charAt(0) == 'i') { s = s.substring(2); Texture tex = new Texture(EngineAssetManager.getInstance().getResAsset("ui/" + s)); tex.setFilter(TextureFilter.Linear, TextureFilter.Linear); images.put(s, tex); } } }
Example #18
Source File: Settings.java From libgdx-demo-pax-britannica with MIT License | 5 votes |
@Override public void show() { GameInstance.getInstance().resetGame(); backgroundFX = new BackgroundFXRenderer(); blackFade = Resources.getInstance().blackFade; back = Resources.getInstance().back; back.setPosition(20, 010); back.setColor(1,1,1,0.5f); collisionBack.set(new Vector3(back.getVertices()[0], back.getVertices()[1], -10),new Vector3(back.getVertices()[10], back.getVertices()[11], 10)); collisionDiffEasy.set(new Vector3(90, 330,-10),new Vector3(190, 360, 10)); collisionDiffMedium.set(new Vector3(240, 330,-10),new Vector3(340, 360, 10)); collisionDiffHard.set(new Vector3(400, 330,-10),new Vector3(500, 360, 10)); collisionFacHealthLow.set(new Vector3(90, 230,-10),new Vector3(190, 260, 10)); collisionFacHealthMedium.set(new Vector3(240, 230,-10),new Vector3(340, 260, 10)); collisionFacHealthHigh.set(new Vector3(400, 230,-10),new Vector3(500, 260, 10)); collisionAntiAliasOff.set(new Vector3(90, 130,-10),new Vector3(190, 160, 10)); collisionAntiAliasOn.set(new Vector3(240, 130,-10),new Vector3(340, 160, 10)); checkboxOn = Resources.getInstance().checkboxOn; checkboxOff = Resources.getInstance().checkboxOff; titleBatch = new SpriteBatch(); titleBatch.getProjectionMatrix().setToOrtho2D(0, 0, 800, 480); fadeBatch = new SpriteBatch(); fadeBatch.getProjectionMatrix().setToOrtho2D(0, 0, 2, 2); font = new BitmapFont(); font.getRegion().getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear); }
Example #19
Source File: Help.java From libgdx-demo-pax-britannica with MIT License | 5 votes |
@Override public void show() { GameInstance.getInstance().resetGame(); blackFade = Resources.getInstance().blackFade; back = Resources.getInstance().back; back.setPosition(20, 010); back.setColor(1,1,1,0.5f); collisionBack.set(new Vector3(back.getVertices()[0], back.getVertices()[1], -10),new Vector3(back.getVertices()[10], back.getVertices()[11], 10)); fighter = Resources.getInstance().fighterOutline; fighter.setRotation(0); bomber = Resources.getInstance().bomberOutline; bomber.setRotation(0); frigate = Resources.getInstance().frigateOutline; frigate.setRotation(0); upgrade = Resources.getInstance().upgradeOutline; upgrade.setRotation(0); titleBatch = new SpriteBatch(); titleBatch.getProjectionMatrix().setToOrtho2D(0, 0, 800, 480); fadeBatch = new SpriteBatch(); fadeBatch.getProjectionMatrix().setToOrtho2D(0, 0, 2, 2); font = new BitmapFont(); font.getRegion().getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear); }
Example #20
Source File: DeltaScreen.java From ud405 with MIT License | 5 votes |
@Override public void show() { Gdx.app.log(TAG, "show() called"); batch = new SpriteBatch(); font = new BitmapFont(); font.getRegion().getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear); font.getData().setScale(FONT_SCALE); }
Example #21
Source File: TextDemo.java From ud405 with MIT License | 5 votes |
@Override public void create() { batch = new SpriteBatch(); // Create the default font font = new BitmapFont(); // Scale it up font.getData().setScale(3); // Set the filter font.getRegion().getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear); }
Example #22
Source File: FPSScreen.java From ud405 with MIT License | 5 votes |
@Override public void show() { Gdx.app.log(TAG, "show() called"); batch = new SpriteBatch(); font = new BitmapFont(); font.getRegion().getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear); font.getData().setScale(FONT_SCALE); }
Example #23
Source File: ScreenMenu.java From RuinsOfRevenge with MIT License | 5 votes |
public ScreenMenu(final ResourceLoader resources, final RuinsOfRevenge game) { super(new Stage(), game); this.resources = resources; this.game = game; this.background = resources.getRegion("background"); background.getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear); this.ruinsOfRevengeText = resources.getRegion("RuinsOfRevenge"); skin = resources.getSkin("uiskin"); Image rorLogo = new Image(ruinsOfRevengeText); TextButton play = new TextButton("Play", skin); TextButton settings = new TextButton("Settings", skin); TextButton exit = new TextButton("Exit", skin); play.addListener(playListener); settings.addListener(settingsListener); exit.addListener(exitListener); table = new Table(skin); table.add(rorLogo).size(600, 200).space(32); table.row(); table.add(play).size(320, 64).space(8); table.row(); table.add(settings).size(320, 64).space(8); table.row(); table.add(exit).size(320, 64).space(8); table.setPosition(Gdx.graphics.getWidth()/2, Gdx.graphics.getHeight()/2); stage.addActor(table); }
Example #24
Source File: Filtering.java From ud406 with MIT License | 5 votes |
@Override public void create() { batch = new SpriteBatch(); viewport = new ScreenViewport(); nearest = new Texture("standing-right.png"); linear = new Texture("standing-right.png"); linear.setFilter(TextureFilter.Linear, TextureFilter.Linear); }
Example #25
Source File: DifficultyScreen.java From ud405 with MIT License | 5 votes |
@Override public void show() { renderer = new ShapeRenderer(); batch = new SpriteBatch(); viewport = new FitViewport(Constants.DIFFICULTY_WORLD_SIZE, Constants.DIFFICULTY_WORLD_SIZE); Gdx.input.setInputProcessor(this); font = new BitmapFont(); font.getData().setScale(Constants.DIFFICULTY_LABEL_SCALE); font.getRegion().getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear); }
Example #26
Source File: BubbleLevelScreen.java From ud405 with MIT License | 5 votes |
@Override public void show() { axisViewport = new FitViewport(WORLD_SIZE, WORLD_SIZE); renderer = new ShapeRenderer(); renderer.setAutoShapeType(true); batch = new SpriteBatch(); textViewport = new ScreenViewport(); font = new BitmapFont(); font.getData().setScale(TEXT_SCALE); font.getRegion().getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear); maxAcceleration = 0; minAcceleration = Float.MAX_VALUE; }
Example #27
Source File: AccelerometerAxesScreen.java From ud405 with MIT License | 5 votes |
@Override public void show() { axisViewport = new FitViewport(WORLD_SIZE, WORLD_SIZE); renderer = new ShapeRenderer(); renderer.setAutoShapeType(true); batch = new SpriteBatch(); textViewport = new ScreenViewport(); font = new BitmapFont(); font.getData().setScale(TEXT_SCALE); font.getRegion().getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear); maxAcceleration = 0; minAcceleration = Float.MAX_VALUE; }
Example #28
Source File: DifficultyScreen.java From ud405 with MIT License | 5 votes |
@Override public void show() { renderer = new ShapeRenderer(); batch = new SpriteBatch(); viewport = new FitViewport(Constants.DIFFICULTY_WORLD_SIZE, Constants.DIFFICULTY_WORLD_SIZE); Gdx.input.setInputProcessor(this); font = new BitmapFont(); font.getData().setScale(Constants.DIFFICULTY_LABEL_SCALE); font.getRegion().getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear); }
Example #29
Source File: DifficultyScreen.java From ud405 with MIT License | 5 votes |
@Override public void show() { renderer = new ShapeRenderer(); batch = new SpriteBatch(); // TODO: Initialize a FitViewport with the difficulty world size constant viewport = new FitViewport(Constants.DIFFICULTY_WORLD_SIZE, Constants.DIFFICULTY_WORLD_SIZE); Gdx.input.setInputProcessor(this); font = new BitmapFont(); // TODO: Set the font scale using the constant we defined font.getData().setScale(Constants.DIFFICULTY_LABEL_SCALE); font.getRegion().getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear); }
Example #30
Source File: WordCloud.java From ud405 with MIT License | 5 votes |
@Override public void create() { batch = new SpriteBatch(); font = new BitmapFont(); font.getRegion().getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear); words = generateWords(WORD_COUNT); }