Package ch.blackspirit.graphics

Examples of ch.blackspirit.graphics.GraphicsListener


    context.draw();
  }
  @Test (expected=IllegalArgumentException.class)
  public void fillTexturedTrianglesNull() throws IOException {
    final ch.blackspirit.graphics.Image image = imageFactory.createImage(this.getClass().getResource("/player1.png"), true);
    context.setGraphicsListener(new GraphicsListener() {
      public void draw(View view, Graphics graphics) {
        graphics.clear();
        graphics.fillTriangles(null, false, image);
      }
      public void init(View view, Graphics renderer) {}
View Full Code Here


    context.draw();
  }
  @Test (expected=IllegalArgumentException.class)
  public void fillTexturedTrianglesImageNull() throws IOException {
    final Triangle[] triangles = getTriangles(false, false, true);
    context.setGraphicsListener(new GraphicsListener() {
      public void draw(View view, Graphics graphics) {
        graphics.clear();
        graphics.fillTriangles(triangles, false, null);
      }
      public void init(View view, Graphics renderer) {}
View Full Code Here

  }
  @Test (expected=IllegalArgumentException.class)
  public void fillTexturedTrianglesWithTexCoordNull() throws IOException {
    final Triangle[] triangles = getTriangles(false, false, true);
    final ch.blackspirit.graphics.Image image = imageFactory.createImage(this.getClass().getResource("/player1.png"), true);
    context.setGraphicsListener(new GraphicsListener() {
      public void draw(View view, Graphics graphics) {
        graphics.clear();
        graphics.fillTriangles(triangles, false, image);
      }
      public void init(View view, Graphics renderer) {}
View Full Code Here

  }
  @Test (expected=IllegalArgumentException.class)
  public void fillTexturedTrianglesWithColorAndTexCoordNull() throws IOException {
    final Triangle[] triangles = getTriangles(false, false, true);
    final ch.blackspirit.graphics.Image image = imageFactory.createImage(this.getClass().getResource("/player1.png"), true);
    context.setGraphicsListener(new GraphicsListener() {
      public void draw(View view, Graphics graphics) {
        graphics.clear();
        graphics.fillTriangles(triangles, true, image);
      }
      public void init(View view, Graphics renderer) {}
View Full Code Here

import ch.blackspirit.graphics.View;

public class PointTest extends JoglTestBase {
  @Test
  public void drawPoints() {
    context.setGraphicsListener(new GraphicsListener() {
      public void draw(View view, Graphics graphics) {
        graphics.clear();
        graphics.drawPoint(0, 0);
        graphics.drawPoint(100, 100);
      }
View Full Code Here

    });
    context.draw()
  }
  @Test
  public void drawPointsWithColor() {
    context.setGraphicsListener(new GraphicsListener() {
      public void draw(View view, Graphics graphics) {
        graphics.clear();
        graphics.setColor(new Color4f(1, 0, 0, 1));
        graphics.drawPoint(0, 0);
        graphics.setColor(new Color4f(0, 1, 0, 1));
View Full Code Here

    animBack.setRepeated(true);
   
    final Color4f white = new Color4f(1,1,1,1);
    final Color4f red = new Color4f(1,0,0,1);

    canvas.setGraphicsListener(new GraphicsListener() {
      long start = System.nanoTime();
      long currTime = start;
      long count = 0;
      long fps = 0;
 
View Full Code Here

    final Color4f white_alpha = new Color4f(1,1,1,.5f);
    final Color4f red = new Color4f(1,0,0,1);
    final Color4f green = new Color4f(0,1,0,1);
    final Color4f blue = new Color4f(0,0,1,1);

    canvas.setGraphicsListener(new GraphicsListener() {
      float angle = 0;
      long start = System.nanoTime();
      long currTime = start;
      long count = 0;
      long fps = 0;
View Full Code Here

       
 
        final AWTCanvas canvas = ServiceLoader.load(ch.blackspirit.graphics.CanvasFactory.class).iterator().next()
            .createAWTCanvas(true);

    canvas.setGraphicsListener(new GraphicsListener() {
      public void draw(View view, Graphics renderer) {
        renderer.clear();
        view.setCamera(-x, -y, 0);
        renderer.clear();
        for(int x = -2; x < 2; x++) {
View Full Code Here

 
    GraphicsContext imageContext = canvas.createImageGraphicsContext(dark);
    walk = animFrontStill;
   
    // Draw the light shine
    imageContext.setGraphicsListener(new GraphicsListener() {
      public void draw(View view, Graphics graphics) {
        view.setCamera(-400+posX, -300+posY, 0);
        graphics.setClearColor(new Color4f(.0f,.0f,.0f, .98f));
        graphics.clear();
        drawLight(graphics, walk, light, posX + xOffset, posY, lightShineRandom3);
        drawLight(graphics, animFire, light, 150 - animFire.getWidth()/2, 100 - animFire.getHeight()/2, lightShineRandom1);
        drawLight(graphics, animFire, light, 650 - animFire.getWidth()/2, 100 - animFire.getHeight()/2, lightShineRandom2);
        drawLight(graphics, animFire, light, 150 - animFire.getWidth()/2, 450 - animFire.getHeight()/2, lightShineRandom3);
        drawLight(graphics, animFire, light, 650 - animFire.getWidth()/2, 450 - animFire.getHeight()/2, lightShineRandom4);
      }
      public void init(View view, Graphics renderer) {
        view.setCamera(0, 0, 0);
        view.setSize(1024, 1024);
      }
      public void sizeChanged(GraphicsContext graphicsContext, View view) {}
    });
   
    canvas.setGraphicsListener(new GraphicsListener() {
      // Variables for fire simulation
      Random random = new Random();
      long lightShineTime = 0;

      long start = System.nanoTime();
View Full Code Here

TOP

Related Classes of ch.blackspirit.graphics.GraphicsListener

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.