Text in XIth3D

Im developing a chess game and i’m trying to make a little info window that pops up at the mouse coords when the mouse hovers over a piece.

Besides using the UIOverlay system what options do i have to display a simple info dialog, all i want is a simple radiused blue rectangle containing textual info so i feel using the UIOverlay system is a bit overkill.

I have a felling i’ll have to use JOGL as i can see no text classes in the Xith3D packages, this i have very little experience with. so if anyone has any ideas it would be great:)

This is exactly what UIOverlay is intended for, why do you think its overkill?

You end up with a single overlay on which you use a Graphics context to draw your text?

In JOGL you’d end up implementing UIOverlay again and its not really that simple.

Kev

An alternative seems to to have your mouse move handler to the following:

  • find out which object the mouse is hovering on (you could pick and call getUserData from whatever SceneGraphObject pick returns)
  • create a text2D object and apply some transforms to move it to the corresponding 3d coordinate

I’m trying to achieve something similar, and I’m considering experimenting with both approaches. The problem is I don’t really have a Text2D object but it’s not too dificult to implement one (specially if you hardcode a fixed font :p).

Probably UIOverlay is still the best solution, but I wonder which provides the best performance.

ps: I have a problem using picking in Xith3d – it seems to take ages and I have sudden drops of FPS! I see that Kevglass (btw, thanks for making those source available! very cool stuff :)) implements his own pt2d to pt3d conversion, but even if I can do that, the process of finding out which of my objects contain that point seems too time consuming. I’m still thinking of a better solution and if I find out anything I’ll post it :wink:

I presumed that the fact that the UI manger has to, at the end of the day call the swing code for all components in the UIWindow, e.g. resizeing code all the differnet panes etc, which i’d imagine is a lot of code compared to just displaying some texture with some text on it.

I’ll give the UI system a go can i just use a canvas to display a rounded rectangle with a bit of text on it using the UIOverlay???