Package ch.blackspirit.graphics

Examples of ch.blackspirit.graphics.GraphicsListener


   
    // Creating video renderer
    final VideoRenderer videoRenderer = new VideoRenderer(canvas.getImageFactory());
    if(!videoRenderer.open(file.toURI().toURL())) System.exit(0);

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


    final int triangleCount = 100;
    final ArrayList<Triangle> triangles = new ArrayList<Triangle>(triangleCount);
    final Triangle[] triangleA = new Triangle[triangleCount];
   
    canvas.setGraphicsListener(new GraphicsListener() {
      long start = System.nanoTime();
      long currTime = start;
      long count = 0;
      long fps = 0;
View Full Code Here

    final Font fontNormal = new Font("SansSerif", Font.PLAIN, 24);
    final Font fontSmall = new Font("SansSerif", Font.PLAIN, 16);
   
    System.out.println("starting demo");
    canvas.setGraphicsListener(new GraphicsListener() {
      long start = System.nanoTime();
      long currTime = start;
      long count = 0;
      long fps = 0;
 
View Full Code Here

    GraphicsContext imageContext = canvas.createImageGraphicsContext(dark);
    walk = animFrontStill;
    GraphicsContext testContext = canvas.createImageGraphicsContext(darktest);
   
    // Draw the light shine
    imageContext.setGraphicsListener(new GraphicsListener() {
      public void draw(View view, Graphics graphics) {
        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);
//        graphics.clearTransformation();
//        graphics.setColor(white);
//        graphics.drawImage(darktest, 128, 128);
      }

      public void init(View view, Graphics renderer) {
        view.setCamera(0, 0, 0);
        view.setSize(256, 256);
      }

      public void sizeChanged(GraphicsContext graphicsContext, View view) {}
    });
    testContext.setGraphicsListener(new GraphicsListener() {
      public void draw(View view, Graphics graphics) {
        graphics.setClearColor(new Color4f(.1f,.0f,.0f,.98f));
        graphics.clear();
      }

      public void init(View view, Graphics renderer) {
        view.setCamera(0, 0, 0);
        view.setSize(256, 256);
      }

      public void sizeChanged(GraphicsContext graphicsContext, View view) {}
    });
 
   
    System.out.println("starting demo");
    canvas.setGraphicsListener(new GraphicsListener() {
      // Variables for fire simulation
      Random random = new Random();
      long lightShineTime = 0;

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

    springSystem.addUpdater(springProperty);

    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.currentTimeMillis();
      long currTime = start;
      long count = 0;
      long fps = 0;
     
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.