Recheckout your CVS. It should be solved. You probably checked yout while I was checking in. And this is not used in that context anymore. I included HIAL into my RenderLoop class.

Hmm.... in the while I added the methods myself OK about the stone image is it normal that when you click on it it scales and translate ?About your @author tag : please replace "ö" by "oe" (or is it "ü" ? in which case you would put "ue"). These accentued characters are a pain (passing from UTF-8 to ISO-8859-1 or inverse makes you loose some.

OK about the stone image is it normal that when you click on it it scales and translate ?

In the moment I'm implementing HUD picking (without the use of 3D-picking) . This is my test reaction of a picking. I checked in my changes for you to have a functional version. This resizing thing is not part of the Widget class, but is in the HUD3DTest class. It will disappear or being replaced by some other test reaction, when I have finished this step.

About your @author tag : please replace "ö" by "oe" (or is it "ü" ? in which case you would put "ue"). These accentued characters are a pain (passing from UTF-8 to ISO-8859-1 or inverse makes you loose some.

OK about the stone image is it normal that when you click on it it scales and translate ?

In the moment I'm implementing HUD picking (without the use of 3D-picking) . This is my test reaction of a picking. I checked in my changes for you to have a functional version. This resizing thing is not part of the Widget class, but is in the HUD3DTest class. It will disappear or being replaced by some other test reaction, when I have finished this step.

About your @author tag : please replace "ö" by "oe" (or is it "ü" ? in which case you would put "ue"). These accentued characters are a pain (passing from UTF-8 to ISO-8859-1 or inverse makes you loose some.

Can't I use &ouml; for an ö?

Hmm no idea. Anyway I rarely use an HTML browser for reading javadocs and &ouml; is just ugly in plain text.ö -> oe and ü -> ue are just the standard way when you don't have accents

The HUD node as the main container can have it's own coordinate system and (0,0) is uppler-left

Interfaces and abstract classes to implement more Widgets

abstract classes to make implementing more Widgets easier

ImageWidget to display an image on your HUD (textured quad)

TextWidget to display text on your HUD (still buggy)

FPSCounter to display the FPS count on your HUD

z-index system to display several Widgets over each others

Widget-picking without the use of 3D picking

move and resize Widgets

I hope this HUD system will be accepted by the community and can serve as a base for more Widgets and features. If anybody needs a Widget, feel free to add it to the package and make use of the abstract base classes and interfaces.

The HUD node as the main container can have it's own coordinate system and (0,0) is uppler-left

Interfaces and abstract classes to implement more Widgets

abstract classes to make implementing more Widgets easier

ImageWidget to display an image on your HUD (textured quad)

TextWidget to display text on your HUD (still buggy)

FPSCounter to display the FPS count on your HUD

z-index system to display several Widgets over each others

Widget-picking without the use of 3D picking

move and resize Widgets

I hope this HUD system will be accepted by the community and can serve as a base for more Widgets and features. If anybody needs a Widget, feel free to add it to the package and make use of the abstract base classes and interfaces.

How about adopting Swing naming conventions for widgets ? TextWidget would become Label.. I think it's easier when you come from Swing (when you learn Java you usually learn a bit of Swing in the meanwhile)

How about adopting Swing naming conventions for widgets ? TextWidget would become Label.. I think it's easier when you come from Swing (when you learn Java you usually learn a bit of Swing in the meanwhile)

How about adopting Swing naming conventions for widgets ? TextWidget would become Label.. I think it's easier when you come from Swing (when you learn Java you usually learn a bit of Swing in the meanwhile)

I totally agree and renamed TextWidget to Label.

Also, having the "Widget" suffix is fine for containers but not for regular widgets (Labels, Images, Buttons, CheckLists, etc..)

EDIT : News : I wonder how we could handle event. for now a MouseDevice is passed to the constructor of ImageButton but it's not really clean.. And how can I access the "HUD" object from a Widget ? I need to do picking inside the ImageButton class.

EDIT : News : I wonder how we could handle event. for now a MouseDevice is passed to the constructor of ImageButton but it's not really clean.. And how can I access the "HUD" object from a Widget ? I need to do picking inside the ImageButton class.

Everytime you click the mouse the main mouse listener in the RenderLoop calls the pick mehtod on the HUD. This method dispatches this event to all Widgets. just overrider the pick method of RectangularWidget with a super call. There you can get the information you need.

About a hover effect... I will implement a method on the HUD class which is called by the mouseMoved event and that works just like the pick method. Then you will be able to regisster a mouse over event.

I for one would enjoy a cheap demo off the xith.org site, if its not a pain. Right now I am locked into an older version of xith until I finish this phase. Several UI alternatives have been discussed in the past, having one out there and avaqilble for play might help get addional momentum for this version.

I've implemented the Listener thing and some other methods. recheckout your CVS. Please note, that I've used other images for the Button, because I didn't have yours. Please put your button test images into the demo folder of xith-tk and check them to CVS. The demo folder is registered to the TextureLoader, so can pass the image names to the Button constructor without the path.

EDIT : News : I wonder how we could handle event. for now a MouseDevice is passed to the constructor of ImageButton but it's not really clean.. And how can I access the "HUD" object from a Widget ? I need to do picking inside the ImageButton class.

Everytime you click the mouse the main mouse listener in the RenderLoop calls the pick mehtod on the HUD. This method dispatches this event to all Widgets. just overrider the pick method of RectangularWidget with a super call. There you can get the information you need.

About a hover effect... I will implement a method on the HUD class which is called by the mouseMoved event and that works just like the pick method. Then you will be able to regisster a mouse over event.

I for one would enjoy a cheap demo off the xith.org site, if its not a pain. Right now I am locked into an older version of xith until I finish this phase. Several UI alternatives have been discussed in the past, having one out there and avaqilble for play might help get addional momentum for this version.

Hmm please wait 30 minutes I added that to my TODO list I'm studying the JWS mechanism used by William Denniss on the site.

Hmm Qudus the button widget does not work really good, cause the image change is called directly from the AWT Event thread (may cause threadind problems : Xith doesn't support multi-threading). I think I can use ScheduledOperations to change image, but how to implement that, HUD is not based on an ExtRenderLoop ?

I'll investigate please don't do that for me (hey it's not fun if you just code everything )

Hmm Qudus the button widget does not work really good, cause the image change is called directly from the AWT Event thread (may cause threadind problems : Xith doesn't support multi-threading). I think I can use ScheduledOperations to change image, but how to implement that, HUD is not based on an ExtRenderLoop ?

hey, good point. And well done. I only changed it a bit, so that not an ExtRenderLoop is expected but an OperationScheduler which is an interface implemented by ExtRenderLoop. I think, this is a little cleaner and I wrote this interface for such a purpose.

Hmm Qudus the button widget does not work really good, cause the image change is called directly from the AWT Event thread (may cause threadind problems : Xith doesn't support multi-threading). I think I can use ScheduledOperations to change image, but how to implement that, HUD is not based on an ExtRenderLoop ?

hey, good point. And well done. I only changed it a bit, so that not an ExtRenderLoop is expected but an OperationScheduler which is an interface implemented by ExtRenderLoop. I think, this is a little cleaner and I wrote this interface for such a purpose.

Text buttons now work. But there's a slight problems with mouse events : they are dispatched twice. (See the "Basic button" to which one "." only should be added per event : as you click there are two dots added).

And also the picking doesn't work properly anymore when you resize the window.

Ans last see the commented line : when I add a background between a TextButton it hides the button background and shows the text (uncomment the line to see the effect).

The ActionListener is now working perfectly (apart from double events).

I think I got the idea about this problem with ImageButtons and the Background.

The Image is never added to an instance of WidgetContainer. Maybe the problem disappeares when you implement an inner class to the ImageButton class which implements WidgetContainer. Link the getContainer mehtod of this class with the Container of the ImageButton. Then add the Image to this container. Only when you add a Widget to a Container, the coordinates are correctly calculated. I don't know if this solves the problem and i'm not at home so I cannot code it. But I tjhink it's worth a try.

And don't directly add the Image to the ImageButton's container, cause this would disturb the children count of the HUD.

Text buttons now work. But there's a slight problems with mouse events : they are dispatched twice. (See the "Basic button" to which one "." only should be added per event : as you click there are two dots added).

And also the picking doesn't work properly anymore when you resize the window.

Ans last see the commented line : when I add a background between a TextButton it hides the button background and shows the text (uncomment the line to see the effect).

The ActionListener is now working perfectly (apart from double events).

So the Exit button now really exits.

Did you recently check out your CVS today? I worked on this problem just three hours ago.

I got the problem concerning the ImageButtons. Finally the solution was easier than I expected.

Amos, please don't put this constructor with the hardcoded image names to the TextButton. I don't think, we should put hardcoded filenames to any class in the tk.

What do you say about merging ImageButton and TextButton to one class? We would put all constructors of both classes together and had one class being able to render a button with or without text and with or without images.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org