public void pinta(Graphics g) { float ancho_anterior = g.getLineWidth(); Color color_anterior = g.getColor(); // ///////////////////////////////// g.setLineWidth(3); this.actualizaAngulo(); g.setColor(new Color(1, 0, 0, 0.2f)); g.fillArc( this.centroX - radio, this.centroY - radio, radio * 2, radio * 2, 270, this.angulo - 90); g.setAntiAlias(true); g.setColor(this.color_reloj); g.drawOval(this.centroX - radio, this.centroY - radio, radio * 2, radio * 2); float px = 0, py = 0; px = (float) (this.centroX + radio * 8 / 10 * Math.cos(Math.toRadians(angulo) - Math.PI / 2)); py = (float) (this.centroY + radio * 8 / 10 * Math.sin(Math.toRadians(angulo) - Math.PI / 2)); g.setColor(color_manilla); g.drawLine(centroX, centroY, px, py); g.setAntiAlias(false); // ///////////////////////////////// g.setLineWidth(ancho_anterior); g.setColor(color_anterior); }
@Override public void render(GameContainer gc, StateBasedGame sb, Graphics g) throws SlickException { // Background etc. g.setAntiAlias(true); g.drawImage( background, gc.getWidth() / 2 - background.getWidth() / 2, gc.getHeight() / 2 - background.getHeight() / 2); uniTitle.drawString( gc.getWidth() / 2 - uniTitle.getWidth("Highscores") / 2, (float) 0, "Highscores", Color.orange); count = 0; // Zeichnet die Überschrift MenuItem item = levelNames.get(0); uniNormal.drawString(item.getPos().x, item.getPos().y, item.getName(), item.getColor()); item = playerNames.get(0); uniNormal.drawString(item.getPos().x, item.getPos().y, item.getName(), item.getColor()); item = times.get(0); uniNormal.drawString(item.getPos().x, item.getPos().y, item.getName(), item.getColor()); // Von start bis zu end for (int i = start; i <= end; i++) { // Falls wir am ende der Liste angekommen sind, abbrechen und itemsOnSide setzen if (i == levelNames.size()) { itemsOnSide = i - start; break; } // Maximale itemsOnSide = 10 else { itemsOnSide = 10; } // Zeichnen der Highscores item = levelNames.get(i); uniNormal.drawString(item.getPos().x, item.getPos().y, item.getName(), item.getColor()); item = playerNames.get(i); uniNormal.drawString(item.getPos().x, item.getPos().y, item.getName(), item.getColor()); item = times.get(i); uniNormal.drawString(item.getPos().x, item.getPos().y, item.getName(), item.getColor()); } g.setColor(Color.green); g.draw(selection); // aktuelle Seite zeichnen String displayside = "Seite " + (side + 1) + " von " + sideCount; uniNormal.drawString( gc.getWidth() / 2 - uniNormal.getWidth(displayside) / 2, gc.getHeight() - uniNormal.getHeight(displayside), displayside, Color.orange); // ESC String uniNormal.drawString( 0, gc.getHeight() - uniNormal.getHeight("ESC = Zurück"), "ESC = Zurück", Color.orange); }
/** * @see org.newdawn.slick.BasicGame#render(org.newdawn.slick.GameContainer, * org.newdawn.slick.Graphics) */ public void render(GameContainer container, Graphics g) { g.rotate(400, 300, ang); g.fill(rect, gradient); g.fill(round, gradient); g.fill(poly, gradient2); g.fill(center, gradient4); g.setAntiAlias(true); g.setLineWidth(10); g.draw(round2, gradient2); g.setLineWidth(2); g.draw(poly, gradient); g.setAntiAlias(false); g.fill(center, gradient4); g.setAntiAlias(true); g.setColor(Color.black); g.draw(center); g.setAntiAlias(false); }
/** * @see org.newdawn.slick.Game#render(org.newdawn.slick.GameContainer, org.newdawn.slick.Graphics) */ public void render(GameContainer container, Graphics g) throws SlickException { g.setAntiAlias(antialias); g.setLineWidth(50); g.setColor(Color.red); g.draw(path); // g.setColor(Color.red); // TextureImpl.bindNone(); // g.setLineWidth(width); // g.setAntiAlias(true); // for (int i=0;i<10;i++) { // g.translate(35,35); // g.draw(polygon); // } // g.translate(-350,-350); // // g.setColor(Color.white); // g.setLineWidth(1); // g.setAntiAlias(false); // g.draw(polygon); }
public void render(GUIContext ctx, Graphics g, Component comp, Skin skin, Theme theme) { // makes sure it's the same as what we're attached to checkComponent(comp); CheckBox check = (CheckBox) comp; Rectangle cachedRect = null; boolean roundRectEnabled = SimpleSkin.isRoundRectanglesEnabled(); // make sure we are showing outline // also, the outline will only render if we aren't rendering a background if (isShowOutline() && (!check.isOpaque() || check.getBackground() == null)) { // get the cached rectangle from the component bounds cachedRect = check.getAbsoluteBounds(); Rectangle bounds = cachedRect; // if we have round rectangles, use them if (roundRectEnabled && roundBounds != null) { roundBounds.setBounds(bounds); bounds = roundBounds; } Color oldCol = g.getColor(); boolean oldAA = g.isAntiAlias(); Color back; if (check.getState() != Button.UP) // hover back = theme.getPrimary1(); else // still back = theme.getPrimary3(); g.setColor(back); g.setAntiAlias(true); g.fill(bounds); g.setAntiAlias(oldAA); g.setColor(oldCol); } // renders base SkinUtil.renderComponentBase(g, check); // renders text/image SkinUtil.renderCheckBoxBase(g, check); // get cached bounds from the "check" box button area Rectangle cachedBox = check.getAbsoluteBoxBounds(); Rectangle btnRect = cachedBox; // try to use round rectangle if (roundRectEnabled && roundBoxBounds != null) { roundBoxBounds.setBounds(cachedBox); btnRect = roundBoxBounds; } // renders the actual button state for the small box area, using rounded edges SimpleButtonAppearance.renderButtonState(g, theme, check, btnRect, grad); Image def = getDefaultImage(); if (def != null && check.isSelected()) { float x = btnRect.getX() + (btnRect.getWidth() / 2f - def.getWidth() / 2f); float y = btnRect.getY() + (btnRect.getHeight() / 2f - def.getHeight() / 2f); g.drawImage(def, (int) x, (int) y, check.getImageFilter()); } }
public void render(GameContainer gameContainer, Graphics graphics) throws SlickException { graphics.setAntiAlias(true); renderer.update(graphics); font.drawString(300, 200, "Meow, World!"); }
public void render(GameContainer gameContainer, Graphics graphics) throws SlickException { graphics.setAntiAlias(true); renderEngine.update(graphics); renderMouseOver(); }