/** Draws selection rectangle **/ protected void drawSelection (Drawable selection, Batch batch, BitmapFont font, float x, float y) { selection.draw(batch, x + textOffset + selectionX + fontOffset, y - textHeight - font.getDescent(), selectionWidth, textHeight); }
/** Draws selection rectangle **/ protected void drawSelection (Drawable selection, Batch batch, BitmapFont font, float x, float y) { selection.draw(batch, x + textOffset + selectionX + fontOffset, y - textHeight - font.getDescent(), selectionWidth, textHeight); }
protected void drawStageBackground (Batch batch, float parentAlpha, float x, float y, float width, float height) { Color color = getColor(); batch.setColor(color.r, color.g, color.b, color.a * parentAlpha); style.stageBackground.draw(batch, x, y, width, height); }
protected void drawStageBackground (Batch batch, float parentAlpha, float x, float y, float width, float height) { Color color = getColor(); batch.setColor(color.r, color.g, color.b, color.a * parentAlpha); style.stageBackground.draw(batch, x, y, width, height); }
/** Called to draw the background, before clipping is applied (if enabled). Default implementation draws the background * drawable. */ protected void drawBackground (Batch batch, float parentAlpha, float x, float y) { if (background == null) return; Color color = getColor(); batch.setColor(color.r, color.g, color.b, color.a * parentAlpha); background.draw(batch, x, y, getWidth(), getHeight()); }
/** Called to draw the background, before clipping is applied (if enabled). Default implementation draws the background * drawable. */ protected void drawBackground (Batch batch, float parentAlpha, float x, float y) { if (background == null) return; Color color = getColor(); batch.setColor(color.r, color.g, color.b, color.a * parentAlpha); background.draw(batch, x, y, getWidth(), getHeight()); }
/** Called to draw the background, before clipping is applied (if enabled). Default implementation draws the background * drawable. */ protected void drawBackground (Batch batch, float parentAlpha, float x, float y) { if (background == null) return; Color color = getColor(); batch.setColor(color.r, color.g, color.b, color.a * parentAlpha); background.draw(batch, x, y, getWidth(), getHeight()); }
/** Called to draw the background, before clipping is applied (if enabled). Default implementation draws the background * drawable. */ protected void drawBackground (Batch batch, float parentAlpha, float x, float y) { if (background == null) return; Color color = getColor(); batch.setColor(color.r, color.g, color.b, color.a * parentAlpha); background.draw(batch, x, y, getWidth(), getHeight()); }
protected void drawCursor (Drawable cursorPatch, Batch batch, BitmapFont font, float x, float y) { cursorPatch.draw(batch, x + textOffset + glyphPositions.get(cursor) - glyphPositions.get(visibleTextStart) + fontOffset + font.getData().cursorX, y - textHeight - font.getDescent(), cursorPatch.getMinWidth(), textHeight); }
protected void drawCursor (Drawable cursorPatch, Batch batch, BitmapFont font, float x, float y) { cursorPatch.draw(batch, x + textOffset + glyphPositions.get(cursor) - glyphPositions.get(visibleTextStart) + fontOffset + font.getData().cursorX, y - textHeight - font.getDescent(), cursorPatch.getMinWidth(), textHeight); }
/** Called to draw the background. Default implementation draws the style background drawable. */ protected void drawBackground (Batch batch, float parentAlpha) { if (style.background != null) { Color color = getColor(); batch.setColor(color.r, color.g, color.b, color.a * parentAlpha); style.background.draw(batch, getX(), getY(), getWidth(), getHeight()); } }
@Override public void render () { Gdx.gl.glClearColor(1, 1, 1, 1); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); batch.begin(); drawable.draw(batch, 0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); batch.end(); }
/** Called to draw the background. Default implementation draws the style background drawable. */ protected void drawBackground (Batch batch, float parentAlpha) { if (style.background != null) { Color color = getColor(); batch.setColor(color.r, color.g, color.b, color.a * parentAlpha); style.background.draw(batch, getX(), getY(), getWidth(), getHeight()); } }
@Override public void draw (Batch batch, float parentAlpha) { validate(); Color c = getColor(); batch.setColor(c.r, c.g, c.b, c.a * parentAlpha); float x = getX(); float y = getY(); float w = getWidth(); float h = getHeight(); final Drawable bg = style.background; if (bg != null) bg.draw(batch, x, y, w, h); final Drawable knob = style.knob; if (knob != null) { x += knobPosition.x - knob.getMinWidth() / 2f; y += knobPosition.y - knob.getMinHeight() / 2f; knob.draw(batch, x, y, knob.getMinWidth(), knob.getMinHeight()); } }
@Override protected void drawCursor (Drawable cursorPatch, Batch batch, BitmapFont font, float x, float y) { float textOffset = cursor >= glyphPositions.size || cursorLine * 2 >= linesBreak.size ? 0 : glyphPositions.get(cursor) - glyphPositions.get(linesBreak.items[cursorLine * 2]); cursorPatch.draw(batch, x + textOffset + fontOffset + font.getData().cursorX, y - font.getDescent() / 2 - (cursorLine - firstLineShowing + 1) * font.getLineHeight(), cursorPatch.getMinWidth(), font.getLineHeight()); }
@Override protected void drawCursor (Drawable cursorPatch, Batch batch, BitmapFont font, float x, float y) { float textOffset = cursor >= glyphPositions.size || cursorLine * 2 >= linesBreak.size ? 0 : glyphPositions.get(cursor) - glyphPositions.get(linesBreak.items[cursorLine * 2]); cursorPatch.draw(batch, x + textOffset + fontOffset + font.getData().cursorX, y - font.getDescent() / 2 - (cursorLine - firstLineShowing + 1) * font.getLineHeight(), cursorPatch.getMinWidth(), font.getLineHeight()); }
public void draw (Batch batch, float parentAlpha) { validate(); Color color = getColor(); batch.setColor(color.r, color.g, color.b, color.a * parentAlpha); float x = getX(); float y = getY(); float scaleX = getScaleX(); float scaleY = getScaleY(); if (drawable instanceof TransformDrawable) { float rotation = getRotation(); if (scaleX != 1 || scaleY != 1 || rotation != 0) { ((TransformDrawable)drawable).draw(batch, x + imageX, y + imageY, getOriginX() - imageX, getOriginY() - imageY, imageWidth, imageHeight, scaleX, scaleY, rotation); return; } } if (drawable != null) drawable.draw(batch, x + imageX, y + imageY, imageWidth * scaleX, imageHeight * scaleY); }
public void draw (Batch batch, float parentAlpha) { validate(); Color color = getColor(); batch.setColor(color.r, color.g, color.b, color.a * parentAlpha); float x = getX(); float y = getY(); float scaleX = getScaleX(); float scaleY = getScaleY(); if (drawable instanceof TransformDrawable) { float rotation = getRotation(); if (scaleX != 1 || scaleY != 1 || rotation != 0) { ((TransformDrawable)drawable).draw(batch, x + imageX, y + imageY, getOriginX() - imageX, getOriginY() - imageY, imageWidth, imageHeight, scaleX, scaleY, rotation); return; } } if (drawable != null) drawable.draw(batch, x + imageX, y + imageY, imageWidth * scaleX, imageHeight * scaleY); }
public void draw (Batch batch, float parentAlpha) { validate(); Color color = tempColor.set(getColor()); color.a *= parentAlpha; if (style.background != null) { batch.setColor(color.r, color.g, color.b, color.a); style.background.draw(batch, getX(), getY(), getWidth(), getHeight()); } if (style.fontColor != null) color.mul(style.fontColor); cache.tint(color); cache.setPosition(getX(), getY()); cache.draw(batch); }
public void draw (Batch batch, float parentAlpha) { validate(); Color color = tempColor.set(getColor()); color.a *= parentAlpha; if (style.background != null) { batch.setColor(color.r, color.g, color.b, color.a); style.background.draw(batch, getX(), getY(), getWidth(), getHeight()); } if (style.fontColor != null) color.mul(style.fontColor); cache.tint(color); cache.setPosition(getX(), getY()); cache.draw(batch); }