use of mathax.client.gui.themes.meteor.MeteorGuiTheme in project Client by MatHax.
the class WMeteorPlus method onRender.
@Override
protected void onRender(GuiRenderer renderer, double mouseX, double mouseY, double delta) {
MeteorGuiTheme theme = theme();
double pad = pad();
double s = theme.scale(3);
renderBackground(renderer, this, pressed, mouseOver);
renderer.quad(x + pad, y + height / 2 - s / 2, width - pad * 2, s, theme.plusColor.get());
renderer.quad(x + width / 2 - s / 2, y + pad, s, height - pad * 2, theme.plusColor.get());
}
use of mathax.client.gui.themes.meteor.MeteorGuiTheme in project Client by MatHax.
the class WMeteorVerticalSeparator method onRender.
@Override
protected void onRender(GuiRenderer renderer, double mouseX, double mouseY, double delta) {
MeteorGuiTheme theme = theme();
Color colorEdges = theme.separatorEdges.get();
Color colorCenter = theme.separatorCenter.get();
double s = theme.scale(1);
double offsetX = Math.round(width / 2.0);
renderer.quad(x + offsetX, y, s, height / 2, colorEdges, colorEdges, colorCenter, colorCenter);
renderer.quad(x + offsetX, y + height / 2, s, height / 2, colorCenter, colorCenter, colorEdges, colorEdges);
}
use of mathax.client.gui.themes.meteor.MeteorGuiTheme in project Client by MatHax.
the class WMeteorSlider method renderBar.
private void renderBar(GuiRenderer renderer, double valueWidth) {
MeteorGuiTheme theme = theme();
double s = theme.scale(3);
double handleSize = handleSize();
double x = this.x + handleSize / 2;
double y = this.y + height / 2 - s / 2;
renderer.quad(x, y, valueWidth, s, theme.sliderLeft.get());
renderer.quad(x + valueWidth, y, width - valueWidth - handleSize, s, theme.sliderRight.get());
}
use of mathax.client.gui.themes.meteor.MeteorGuiTheme in project Client by MatHax.
the class WMeteorSlider method renderHandle.
private void renderHandle(GuiRenderer renderer, double valueWidth) {
MeteorGuiTheme theme = theme();
double s = handleSize();
renderer.quad(x + valueWidth, y, s, s, GuiRenderer.CIRCLE, theme.sliderHandle.get(dragging, handleMouseOver));
}
use of mathax.client.gui.themes.meteor.MeteorGuiTheme in project Client by MatHax.
the class WMeteorTextBox method onRender.
@Override
protected void onRender(GuiRenderer renderer, double mouseX, double mouseY, double delta) {
if (cursorTimer >= 1) {
cursorVisible = !cursorVisible;
cursorTimer = 0;
} else {
cursorTimer += delta * 1.75;
}
renderBackground(renderer, this, false, false);
MeteorGuiTheme theme = theme();
double pad = pad();
double overflowWidth = getOverflowWidthForRender();
renderer.scissorStart(x + pad, y + pad, width - pad * 2, height - pad * 2);
// Text content
if (!text.isEmpty()) {
renderer.text(text, x + pad - overflowWidth, y + pad, theme.textColor.get(), false);
}
// Text highlighting
if (focused && (cursor != selectionStart || cursor != selectionEnd)) {
double selStart = x + pad + getTextWidth(selectionStart) - overflowWidth;
double selEnd = x + pad + getTextWidth(selectionEnd) - overflowWidth;
renderer.quad(selStart, y + pad, selEnd - selStart, theme.textHeight(), theme.textHighlightColor.get());
}
// Cursor
animProgress += delta * 10 * (focused && cursorVisible ? 1 : -1);
animProgress = Utils.clamp(animProgress, 0, 1);
if ((focused && cursorVisible) || animProgress > 0) {
renderer.setAlpha(animProgress);
renderer.quad(x + pad + getTextWidth(cursor) - overflowWidth, y + pad, theme.scale(1), theme.textHeight(), theme.textColor.get());
renderer.setAlpha(1);
}
renderer.scissorEnd();
}
Aggregations