Package stephencarmody.k8.text

Examples of stephencarmody.k8.text.Text


    // Set the text scaling proportional to width
    textScale = layer.getWidth() / 5000;

    // Position
    position = new Text();
    position.setScale(textScale);
    position.moveRight(layer.getWidth() / 2);
    position.moveUp(0.001f);
    layer.add(position);

    // FPS Counter
    fps = new Text();
    fps.setScale(textScale);
    fps.moveRight(0.001f);
    fps.moveUp(0.001f);
    layer.add(fps);
   
View Full Code Here


   
    // Get screen limits
    layer = new Layer(depth);
   
    // Root SceneNode, translated -width/2, -height/2
    scenenode = new SceneNode();
    scenenode.moveRight(-layer.getWidth()/2);
    scenenode.moveUp(-layer.getHeight()/2);
    camera.appendChild(scenenode);
    scenenode.moveForward(depth);
   
View Full Code Here

    public static void main(String[] args) {
      try {
        Log.setLogFile("C:/physics.log");
        Application.setTitle("Physics");
        Application.initialise(400, 300);
        wood = new Texture("/stephencarmody/physics/texture/blonde-wood.jpg");
        new User();
        new State(100f, 0f);
        Application.run();
      } catch ( Throwable t ) {
        String msg = t.toString() + "\n\t";
View Full Code Here

    public static void main(String[] args) {
      try {
        Log.setLogFile("C:/random_rotating_triangles.log");
        Application.setTitle("k8 Test");
        Application.initialise();
        wood = new Texture("/stephencarmody/random_rotating_triangles/texture/blonde-wood.jpg");
        new User();
        new HUD();
        feeder = new TriangleFeeder();
        Application.run();
      } catch ( Throwable t ) {
View Full Code Here

        secs = (float) elapsed / 1000000000;
        fps = Math.round((float)Application.frame()/secs);
        text.setText(TexturedTriangles.count + " @ " + fps + " fps");
       
        if ( fps != lastfps ) {
          t1 = new Triangle();
            t1.texture(Main.wood);
            t1.vertices(0, fps, 0, 0, 0, 0, 1, fps, 0);
            t1.texCoords(0,0,0,1,1,0);
            t2 = new Triangle();
            t2.texture(Main.wood);
            t2.vertices(0, 0, 0, 1, 0, 0, 1, fps, 0);
            t2.texCoords(0,1,1,1,1,0);
            t1.appendChild(t2);
            t1.moveRight(x);
View Full Code Here

      paused = !paused;
    }

    /** Called n times a second, where n is defined by setUpdateRate(n). */
    public void update(long time) {
        t1 = new Triangle();
        t1.texture(Main.wood);
        t1.vertices(-1, 1, 0, 1, 0, 0, 0, 2, 0);
        t1.texCoords(0,0,0,1,1,0);
        t2 = new Triangle();
        t2.texture(Main.wood);
        t2.vertices(-1, 1, 0, 0, 2, 0, 1, 0, 0);
        t2.texCoords(0,0,0,1,1,0);
        t1.appendChild(t2);
       
View Full Code Here

        Log.setLogFile("C:/physics.log");
        Application.setTitle("Physics");
        Application.initialise(400, 300);
        wood = new Texture("/stephencarmody/physics/texture/blonde-wood.jpg");
        new User();
        new State(100f, 0f);
        Application.run();
      } catch ( Throwable t ) {
        String msg = t.toString() + "\n\t";
        StackTraceElement[] stack = t.getStackTrace();
        for ( StackTraceElement s : stack ) msg += "at " + s.getClassName() + "." + s.getMethodName()+ "\n\t";
View Full Code Here

   
    // Set the text scaling proportional to width
    textScale = layer.getWidth()/2000;
   
    // Position
    position = new Text();
    position.setScale(textScale);
    position.moveRight(layer.getWidth()/2);
    position.moveUp(0.001f);
    scenenode.appendChild(position);
   
    // FPS Counter
    fpsCounter = new FPSCounter();
        Text text = fpsCounter.getText();
        text.setScale(textScale);
        text.moveRight(0.001f);
        text.moveUp(0.001f);
        scenenode.appendChild(text);
   
    setUpdateRate(10);
  }
View Full Code Here

    private int x;
   
    /** Creates a new instance of FPSCounter */
    public FPSCounter() {
      setUpdateRate(1);
      text = new Text();
      x = -100;
    }
View Full Code Here

   
    // Set default depth at just a little further than near clipping plane
    depth = camera.getNearClip() + 0.1f;
   
    // Get screen limits
    layer = new Layer(depth);
   
    // Root SceneNode, translated -width/2, -height/2
    scenenode = new SceneNode();
    scenenode.moveRight(-layer.getWidth()/2);
    scenenode.moveUp(-layer.getHeight()/2);
View Full Code Here

TOP

Related Classes of stephencarmody.k8.text.Text

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.