Examples of SpriteManager


Examples of kku.cs.fgl.SpriteManager

    }

    @Override
    public void init() {
      SpriteSheet fmanSheet = new SpriteSheet("fireman.gif",60,60);
      SpriteManager fsprite = new SpriteManager();
      fsprite.add("stand",fmanSheet,0);
      fsprite.add("run",fmanSheet,1,2,3,4);
      fsprite.add("jump",fmanSheet,5);
      fsprite.add("sit",fmanSheet,6);
      fsprite.add("shoot",fmanSheet,7);     
      FireManActor actor = new FireManActor(fsprite);
      actor.setLocation(300,20);
      add(actor);
    }
View Full Code Here

Examples of org.graphstream.ui.spriteManager.SpriteManager

    Node C = main.addNode("C");
    main.addEdge("AB", "A", "B");
    main.addEdge("BC", "B", "C");
    main.addEdge("CA", "C", "A");

    SpriteManager sman = new SpriteManager(main);
    Sprite S1 = sman.addSprite("S1");
    Sprite S2 = sman.addSprite("S2");
    Sprite S3 = sman.addSprite("S3");

    S3.setPosition(1, 2, 2);
    S3.setPosition(2, 3, 2);
    S3.setPosition(3, 2, 1);

    A.addAttribute("ui.foo", "bar");
    B.addAttribute("ui.bar", "foo");
    C.addAttribute("truc"); // Not prefixed by UI, will not pass.
    S1.addAttribute("ui.foo", "bar");
    main.stepBegins(1);

    toMain.pump();

    // We ask the Swing thread to modify the graphic graph.

    main.stepBegins(2);
    main.addAttribute("ui.EQUIP"); // Remember GraphicGraph filters
                    // attributes.

    // Wait and stop.

    toMain.pump();
    sleep(1000);
    toMain.pump();

    main.addAttribute("ui.STOP");

    toMain.pump();
    sleep(1000);
    toMain.pump();

    // ****************************************************************************************
    // Now we can begin the real test. We ensure the timer in the Swing
    // graph stopped and check
    // If the two graphs (main and graphic) synchronized correctly.

    GraphicGraph graphic = viewerThread.graphic;

    assertTrue(viewerThread.isStopped());
    assertFalse(main.hasAttribute("ui.EQUIP"));
    assertFalse(graphic.hasAttribute("ui.EQUIP"));
    assertTrue(main.hasAttribute("ui.STOP"));
    assertTrue(graphic.hasAttribute("ui.STOP"));

    assertEquals(3, graphic.getStep(), 0);
    assertEquals(2, main.getStep(), 0); // We do not listen at elements events
                      // the step 3
                      // of the graphic graph did not
                      // reached us.
    // Assert all events passed toward the graphic graph.

    assertEquals(3, graphic.getNodeCount());
    assertEquals(3, graphic.getEdgeCount());
    assertEquals(3, graphic.getSpriteCount());
    assertNotNull(graphic.getNode("A"));
    assertNotNull(graphic.getNode("B"));
    assertNotNull(graphic.getNode("C"));
    assertNotNull(graphic.getEdge("AB"));
    assertNotNull(graphic.getEdge("BC"));
    assertNotNull(graphic.getEdge("CA"));
    assertNotNull(graphic.getSprite("S1"));
    assertNotNull(graphic.getSprite("S2"));
    assertEquals("bar", graphic.getNode("A").getAttribute("ui.foo"));
    assertEquals("foo", graphic.getNode("B").getAttribute("ui.bar"));
    // assertNull( graphic.getNode("C").getAttribute( "truc" ) ); // Should
    // not pass the attribute filter.
    assertEquals("bar", graphic.getSprite("S1").getAttribute("ui.foo"));
    assertEquals("bar", sman.getSprite("S1").getAttribute("ui.foo"));

    // Assert attributes passed back to the graph from the graphic graph.

    Object xyz1[] = { 4, 3, 2 };
    Object xyz2[] = { 2, 1, 0 };
View Full Code Here

Examples of org.graphstream.ui.spriteManager.SpriteManager

  public DemoViewerJComponents() {
    Graph graph = new MultiGraph("main graph");
    ThreadProxyPipe toSwing = new ThreadProxyPipe(graph);
    Viewer viewer = new Viewer(toSwing);
    ProxyPipe fromSwing = viewer.newThreadProxyOnGraphicGraph();
    SpriteManager sman = new SpriteManager(graph);

    fromSwing.addAttributeSink(graph);
    viewer.addDefaultView(true);

    Node A = graph.addNode("A");
    Node B = graph.addNode("B");
    Node C = graph.addNode("C");

    graph.addEdge("AB", "A", "B");
    graph.addEdge("BC", "B", "C");
    graph.addEdge("CA", "C", "A");

    A.addAttribute("xyz", 0, 1, 0);
    B.addAttribute("xyz", 1, 0, 0);
    C.addAttribute("xyz", -1, 0, 0);

    A.addAttribute("ui.label", "Quit");
    B.addAttribute("ui.label", "Editable text");
    C.addAttribute("ui.label", "Click to edit");

    graph.addAttribute("ui.stylesheet", styleSheet);

    Sprite s1 = sman.addSprite("S1");
    Sprite s2 = sman.addSprite("S2");
    Sprite s3 = sman.addSprite("S3");

    s1.attachToNode("B");
    s2.attachToEdge("BC");
    s1.setPosition(StyleConstants.Units.PX, 1, 0, 0);
    s2.setPosition(0.5f);
View Full Code Here

Examples of org.sfaci.bombermanx.managers.SpriteManager

  public GameScreen(Bombermanx game) {
    this.game = game;
     
    ResourceManager.loadAllResources();
   
    spriteManager = new SpriteManager(game);
    levelManager = new LevelManager(spriteManager);
    levelManager.loadCurrentLevel();
   
    Gdx.input.setInputProcessor(this);
  }
View Full Code Here

Examples of org.sfaci.jumper2dx.managers.SpriteManager

    public SpriteManager spriteManager;
 
  public GameScreen(Jumper2DX game) {
    this.game = game;

        spriteManager = new SpriteManager(game);
        game.paused = false;
  }
View Full Code Here

Examples of org.sfsoft.jfighter2dx.managers.SpriteManager

   
    // Carga de todos los recursos del juego (gráficos, sonidos, . . .)
    ResourceManager.loadAllResources();   
   
    // Inicializa los elementos del juego
    spriteManager = new SpriteManager(game);
    // Inicializa el creador de niveles
    levelManager = new LevelManager(spriteManager);
    levelManager.readCurrentLevelFile();
   
    shapeRenderer = new ShapeRenderer();
View Full Code Here

Examples of res.players.Queen.SpriteManager

        reducedSize =  new Vec2(0.6f,0.35f);
        standardSize =  new Vec2(0.3f,0.7f);
        description = "use the SPECIAL key to become INVISIBLE";
        presentation = "res/players/kittycat/kittysr.png";

        actions.addAction("actionManager", new SpriteManager());



    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.