public void run () { Pixmap pixmap = new Pixmap(rawImageBytes, 0, rawImageBytes.length); texture = new Texture(pixmap); } });
/** Creates a BitmapFont from a BMFont file, using the specified image for glyphs. Any image specified in the BMFont file is * ignored. * @param flip If true, the glyphs will be flipped for use with a perspective where 0,0 is the upper left corner. * @param integer If true, rendering positions will be at integer values to avoid filtering artifacts. */ public BitmapFont (FileHandle fontFile, FileHandle imageFile, boolean flip, boolean integer) { this(new BitmapFontData(fontFile, flip), new TextureRegion(new Texture(imageFile, false)), integer); ownsTexture = true; }
/** Creates a BitmapFont from a BMFont file, using the specified image for glyphs. Any image specified in the BMFont file is * ignored. * @param flip If true, the glyphs will be flipped for use with a perspective where 0,0 is the upper left corner. * @param integer If true, rendering positions will be at integer values to avoid filtering artifacts. */ public BitmapFont (FileHandle fontFile, FileHandle imageFile, boolean flip, boolean integer) { this(new BitmapFontData(fontFile, flip), new TextureRegion(new Texture(imageFile, false)), integer); ownsTexture = true; }
public void setImageBackground (File file) { if (bgImage != null) { bgImage.getTexture().dispose(); bgImage = null; } if (file != null) { bgImage = new Sprite(new Texture(Gdx.files.absolute(file.getAbsolutePath()))); } }
/** @param pageWidth The width of the backing texture. * @param pageHeight The height of the backing texture. */ GlyphPage (UnicodeFont unicodeFont, int pageWidth, int pageHeight) { this.unicodeFont = unicodeFont; this.pageWidth = pageWidth; this.pageHeight = pageHeight; texture = new Texture(pageWidth, pageHeight, Format.RGBA8888); rows.add(new Row()); }
@Override public void create () { spriteBatch = new SpriteBatch(); texture = new Texture(Gdx.files.internal("data/test.png")); } }
@Override public void create () { renderer = new ImmediateModeRenderer20(false, true, 1); texture = new Texture(Gdx.files.internal("data/badlogic.jpg")); } }
/** @param pageWidth The width of the backing texture. * @param pageHeight The height of the backing texture. */ GlyphPage (UnicodeFont unicodeFont, int pageWidth, int pageHeight) { this.unicodeFont = unicodeFont; this.pageWidth = pageWidth; this.pageHeight = pageHeight; texture = new Texture(pageWidth, pageHeight, Format.RGBA8888); rows.add(new Row()); }
@Override public void create () { region = new TextureRegion(new Texture("data/badlogicsmall.jpg")); batch = new SpriteBatch(); renderer = new ShapeRenderer(); renderer.setProjectionMatrix(batch.getProjectionMatrix()); }
@Override public Texture load (String fileName) { Texture result = new Texture(Gdx.files.internal(fileName), useMipMaps); result.setFilter(minFilter, magFilter); result.setWrap(uWrap, vWrap); return result; } }
@Override protected Texture createTexture (FrameBufferTextureAttachmentSpec attachmentSpec) { GLOnlyTextureData data = new GLOnlyTextureData(bufferBuilder.width, bufferBuilder.height, 0, attachmentSpec.internalFormat, attachmentSpec.format, attachmentSpec.type); Texture result = new Texture(data); result.setFilter(TextureFilter.Linear, TextureFilter.Linear); result.setWrap(TextureWrap.ClampToEdge, TextureWrap.ClampToEdge); return result; }
@Override protected Texture createTexture (FrameBufferTextureAttachmentSpec attachmentSpec) { GLOnlyTextureData data = new GLOnlyTextureData(bufferBuilder.width, bufferBuilder.height, 0, attachmentSpec.internalFormat, attachmentSpec.format, attachmentSpec.type); Texture result = new Texture(data); result.setFilter(TextureFilter.Linear, TextureFilter.Linear); result.setWrap(TextureWrap.ClampToEdge, TextureWrap.ClampToEdge); return result; }
public void create () { batch = new SpriteBatch(); // Load a texture with premultiplied alpha FileTextureData data = new FileTextureData(Gdx.files.internal("data/premultiplied_alpha_test.png"), null, null, false); goodTexture = new Texture(data); // Load the texture again. But this time, force the GWT implementation of Pixmap to move to a Canvas representation of the image Pixmap pixmap = new Pixmap(Gdx.files.internal("data/premultiplied_alpha_test.png")); pixmap.getPixel(0, 0); FileTextureData data1 = new FileTextureData(null, pixmap, null, false); badTexture = new Texture(data1); }
@Override public void create () { font = new BitmapFont(Gdx.files.internal("data/arial-15.fnt"), false); batch = new SpriteBatch(); texture = new Texture(Gdx.files.internal("data/badlogicsmall.jpg")); }
@Override public void create () { batch = new SpriteBatch(); font = new BitmapFont(); tex = new Texture(Gdx.files.internal("data/badlogic.jpg")); DisplayMode[] modes = Gdx.graphics.getDisplayModes(); for (DisplayMode mode : modes) { System.out.println(mode); } Gdx.app.log("FullscreenTest", Gdx.graphics.getBufferFormat().toString()); }
@Override public void create () { texture = new Texture(Gdx.files.internal("data/black_marked_0.png")); region = new TextureRegion(texture); batch = new SpriteBatch(); batch.getTransformMatrix().setToTranslation(30.5f, 30.5f, 0); }
@Override public void create () { batch = new SpriteBatch(); texture = new Texture(Gdx.files.internal("data/g2d/progressive-libgdx.jpg")); texture.setFilter(TextureFilter.Linear, TextureFilter.Linear); drawable = new TextureRegionDrawable(new TextureRegion(texture)); }
@Override public void create () { Pixmap pixmap = new Pixmap(256, 256, Format.RGBA8888); pixmap.setColor(1, 0, 0, 1); pixmap.fill(); texture = new Texture(pixmap, false); texture.setFilter(TextureFilter.Linear, TextureFilter.Linear); batch = new SpriteBatch(); pixmap.dispose(); }