GUI Demo

Since a lot of people have been using the Xith3D GUI stuff, I put together a complete test of the gui. Download the following and extract it somwhere. If you don’t have xith3d installed in /xith3d then edit runtest.bat and change the line that says set xith3d=/xith3d to whereever you have it.

This is the code right out of the magicosm project, including the gui artwork which is stored in cosm-default-skin.jar. I have no issues with this code being dispersed since we are allowing our players to build new skins, but the code is our copyright and so is the artwork.

http://www.magicosm.net/xith3d/xith3d-gui-demo.zip

The main frame is an alpha bordered window and you can see that the edges are slightly indented from the corners.

Every line of code for the demo is included, excepting the code in Xith3d which you already have. 99 percent of the magic of the GUI is just swing tricks and is unrelated to Xith3D gui. The skinning system reads an XML file and sets up the graphic skin components with the right bitmaps.

David,

Thank you very much for sharing your code! That is really impressive work.

Do you mind if I add a link to it on http://xith.org/demo if I also link to your post so people are made aware of your copyright wishes?

It’s great to have some examplar code - especially for us who havn’t done too much tricky Swing stuff before (let along swing with Xith3D).

Thanks again,

Will.

Thanks David!
THis will help a lot!! You rock!! ;D

Awesome stuff! Thanks a lot David. :slight_smile:

The demo always runs fine with the xith3d.jar you provided with your download. If I use the CVS version of Xith3D it occasionally crashes when scrolling down vertically.

Fetching the zip file and a freshly checked out xith3d I get the following exception:

Hit SPACE to toggle projection policy, or ESC to exit
mapped com.magicosm.skins.SkinRaisedPanel to com.magicosm.skins.styles.ControlSt
yle
mapped com.magicosm.skins.SkinSmallPrompt to com.magicosm.skins.styles.ControlSt
yle
mapped com.magicosm.skins.SkinInternalPanel to com.magicosm.skins.styles.Control
Style
mapped com.magicosm.skins.SkinButton to com.magicosm.skins.styles.ControlStyle
mapped com.magicosm.skins.SkinTabbedPane to com.magicosm.skins.styles.ControlSty
le
mapped com.magicosm.skins.SkinPanel to com.magicosm.skins.styles.ControlStyle
mapped com.magicosm.skins.SkinCheckBox to com.magicosm.skins.styles.ControlStyle

mapped com.magicosm.skins.SkinCheckBox to com.magicosm.skins.styles.ControlStyle

mapped com.magicosm.skins.SkinCheckBox to com.magicosm.skins.styles.ControlStyle

mapped com.magicosm.skins.SkinPanel to com.magicosm.skins.styles.ControlStyle
mapped com.magicosm.skins.SkinScrollPane to com.magicosm.skins.styles.ControlSty
le
mapped com.magicosm.skins.SkinScrollbar to com.magicosm.skins.styles.ScrollbarSt
yle
size is 15
mapped com.magicosm.skins.SkinScrollbar to com.magicosm.skins.styles.ScrollbarSt
yle
size is 15
Exception in thread “main” java.lang.NoSuchMethodError: TestWindow.setPosition(I
I)V
at Xith3DGuiTest.init(Xith3DGuiTest.java:209)
at Xith3DGuiTest.main(Xith3DGuiTest.java:252)

  • elias

Same exception in linux btw.

  • elias

Ah, my bad. CVS should be up to date now. Let me know if there are any other issues.