GraphStream Users

Archives de la liste Aide


Re: Sprites question


Chronologique Discussions 
  • From: Eduardo Lidanski <eduardo.lidanski AT pikolab.net>
  • To: graphstream-users AT litislab.fr, Antoine Dutot <antoine.dutot AT gmail.com>
  • Subject: Re: Sprites question
  • Date: Fri, 29 Nov 2013 10:46:25 +0100

Hi Antoine,

as I told you, I have issues with the sprites. I created a testcase to demonstrate this.

When I show the second sprite (S2), the first one (S1) disappears. So I only see S2, but I should see S1 and S2.

If I comment out the part:
Sprite s2 = spriteManager.addSprite("S2");
 s2.setPosition(Units.PX, 20, 20, 0);
 s2.attachToNode("B");
 s2.addAttribute("ui.label", "S2");

I see S1 only, which is correct. But, as I said, if I put a second sprite (S2) the first one (S1) disappears.

Am I doing something wrong or is this an issue?

Best regards,
Eduardo


public class Test {

    public static void main(String args[]) {

        DefaultGraph g = new DefaultGraph("Graph");
        SpriteManager spriteManager = new SpriteManager(g);
     

        g.addNode("A");
        Sprite s1 = spriteManager.addSprite("S1");
        s1.setPosition(Units.PX, 20, 20, 0);
        s1.attachToNode("A");
        s1.addAttribute("ui.label", "S1");
       
        g.addNode("B");

        Sprite s2 = spriteManager.addSprite("S2");
        s2.setPosition(Units.PX, 20, 20, 0);
        s2.attachToNode("B");
        s2.addAttribute("ui.label", "S2");
       
        g.addNode("C");

        g.addEdge("AB", "A", "B");

        g.addEdge("AC", "A", "C");

        g.addEdge("BC", "B", "C");

        g.display();
       
    }

}
Am 26.11.2013 11:00, schrieb Antoine Dutot:
Hello Eduardo,

Indeed there was a bug in the text rendering. Thanks for repporting. It should be fixed in the next nightly build :


Tell us if it works.

Antoine


2013/11/25 Eduardo Lidanski <eduardo.lidanski AT pikolab.net>
Hi,

I am not sure why the sprite label is being displayed on the upper left position and is static (refer to screenshot.png).

What am I doing wrong?

public class Test {

    public static void main(String args[]) {

        DefaultGraph g = new DefaultGraph("Graph");
        SpriteManager spriteManager = new SpriteManager(g);


        g.addNode("A");
        Sprite s = spriteManager.addSprite("S");
        s.setPosition(Units.PX, 20, 20, 0);
        s.attachToNode("A");
        s.addAttribute("ui.label", "Sprite text");


        g.addNode("B");

        g.addNode("C");

        g.addEdge("AB", "A", "B");

        g.addEdge("AC", "A", "C");

        g.addEdge("BC", "B", "C");

        g.display();

    }


Thank you,
Eduardo






Archives gérées par MHonArc 2.6.16.

Top of page