private void fillCaches () { String text = "This is a TEST\nxahsdhwekjhasd23���$%$%/%&"; singleLineCache.setColor(0, 0, 1, 1); singleLineCache.setText(text, 10.2f, 30.5f); multiLineCache.setColor(0, 0, 1, 1); multiLineCache.setText(text, 10.5f, 180.5f, 200, Align.center, false); singleLineCacheNonInteger.setColor(0, 1, 0, 1); singleLineCacheNonInteger.setText(text, 10.2f, 30.5f); multiLineCacheNonInteger.setColor(0, 1, 0, 1); multiLineCacheNonInteger.setText(text, 10.5f, 180.5f, 200, Align.center, false); }
private void createCaches (String type, BitmapFontCache cache1, BitmapFontCache cache2, BitmapFontCache cache3, BitmapFontCache cache4, BitmapFontCache cache5) { cache1.setText("(" + type + ")", 10, 320 - 66); String text = "Sphinx of black quartz,\njudge my vow."; cache2.setColor(Color.RED); cache2.setText(text, 5, 320 - 300); text = "How quickly\ndaft jumping zebras vex."; cache3.setColor(Color.BLUE); cache3.setText(text, 5, 320 - 200, 470, Align.center, false); text = "Kerning: LYA moo"; cache4.setText(text, 210, 320 - 66, 0, text.length() - 3, 0, Align.left, false); text = "Forsaking monastic tradition, twelve jovial friars gave\nup their vocation for a questionable existence on the flying trapeze."; cache5.setColor(red); cache5.setText(text, 0, 320 - 300, 480, Align.center, false); }
@Override public void create () { Preferences pref = Gdx.app.getPreferences("test"); boolean resultb = pref.getBoolean("test"); int resulti = pref.getInteger("test"); shader = new ShaderProgram(Gdx.files.internal("data/shaders/shader-vs.glsl"), Gdx.files.internal("data/shaders/shader-fs.glsl")); if (!shader.isCompiled()) throw new GdxRuntimeException(shader.getLog()); mesh = new Mesh(VertexDataType.VertexBufferObject, true, 6, 0, VertexAttribute.Position(), VertexAttribute.TexCoords(0)); mesh.setVertices(new float[] {-0.5f, -0.5f, 0, 0, 1, 0.5f, -0.5f, 0, 1, 1, 0.5f, 0.5f, 0, 1, 0, 0.5f, 0.5f, 0, 1, 0, -0.5f, 0.5f, 0, 0, 0, -0.5f, -0.5f, 0, 0, 1}); texture = new Texture(new Pixmap(Gdx.files.internal("data/badlogic.jpg")), true); texture.setFilter(TextureFilter.MipMap, TextureFilter.Linear); String params = Gdx.files.internal("data/gwttestparams.txt").readString(); numSprites = Integer.parseInt(params); batch = new SpriteBatch(); positions = new ArrayList<Vector2>(); for (int i = 0; i < numSprites; i++) { positions.add(new Vector2(MathUtils.random() * Gdx.graphics.getWidth(), MathUtils.random() * Gdx.graphics.getHeight())); } sprite = new Sprite(texture); sprite.setSize(64, 64); sprite.setOrigin(32, 32); font = new BitmapFont(Gdx.files.internal("data/arial-15.fnt"), false); cache = font.newFontCache(); cache.setColor(Color.RED); cache.setText("This is a Test", 0, 0); atlas = new TextureAtlas(Gdx.files.internal("data/pack")); }
public void setStyle (WindowStyle style) { if (style == null) throw new IllegalArgumentException("style cannot be null."); this.style = style; setBackground(style.background); titleCache = new BitmapFontCache(style.titleFont); titleCache.setColor(style.titleFontColor); if (title != null) setTitle(title); invalidateHierarchy(); }
if (RadixClient.getInstance().getSettingsManager().getVisualSettings().getNonContinuous().getValue()) { fpsStr = fpsStr.concat(" (NON-CONTINUOUS! INACCURATE!)"); fpsRender.setColor(Color.RED);