Package gwt.g2d.client.graphics

Examples of gwt.g2d.client.graphics.DirectShapeRenderer


 
  /**
   * Draws directly onto the surface using {@link DirectShapeRenderer}.
   */
  private void drawDirectly(Surface surface) {
    DirectShapeRenderer shapeRenderer = new DirectShapeRenderer(surface);
    shapeRenderer.beginPath()
        .drawLineSegment(40, 20, 180, 20)
        .drawQuadraticCurveTo(200, 20, 200, 40)
        .drawLineTo(200, 180)
        .drawQuadraticCurveTo(200, 200, 180, 200)
        .drawLineTo(40, 200)
        .drawQuadraticCurveTo(20, 200, 20, 180)
        .drawLineTo(20, 40)
        .drawQuadraticCurveTo(20, 20, 40, 20)
        .moveTo(50, 50)
        .drawArc(50, 50, 15, (float) Math.toRadians(30), (float) Math.toRadians(-30), false)
        .closePath()
        .stroke();
    shapeRenderer.beginPath()
        .drawEllipse(20, 100, 180, 100)
        .closePath()
        .stroke();
    shapeRenderer.beginPath();
    for (int i = 0; i < 8; i++) {
      shapeRenderer.drawCircle(80 + i * 12, 50, 1);
    }
    shapeRenderer.closePath().fill();
  }
View Full Code Here


  }
 
  @Override
  public void initialize() {
    add(getPrimarySurface());
    shapeRenderer = new DirectShapeRenderer(getPrimarySurface());
    particles.clear();
    for (int i = 0; i < NUM_PARTICLES; i++) {
      particles.add(new Particle(
          new Vector2(Random.nextInt(WIDTH), Random.nextInt(HEIGHT)),
          new Vector2(Math.random(), Math.random()).normalize(),
View Full Code Here

  }

  @Override
  public void initialize() {
    super.initialize();
    shapeRenderer = new DirectShapeRenderer(getPrimarySurface());
    sprites.clear();
    sprites.add(new Sprite());
  }
View Full Code Here

TOP

Related Classes of gwt.g2d.client.graphics.DirectShapeRenderer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.