为Flare 的EdgeSprite添加 Edge Label

http://goosebumps4all.net/34all/bb/showthread.php?tid=182

using the Labeler operator to add edge labels

Good morning,

this demo adds labels to edges with help of the Labeler operator. Doing this is a bit more complicated than adding labels to nodes since the edge label position has to updated whenever the edge is rendered newly (as far as I understand), independent of which labeler policy is chosen (Labeler.CHILD or Labeler.LAYER). This seems to be case since the x and y position fields of an EdgeSprite are not set newly (or at all) when an EdgeSprite is changing its position. (happy to be refuted on that)

Here we choose the Labeler.LAYER policy since we want to ensure that edge labels are always drawn above all edges.

   

Cheers

martin

你可能感兴趣的:(Sprite)