ui xith3d

hey hasait

your stuff really looks and works nice :smiley: !!!

but theres one thing that bugs me: if the mouse is above these dialogs the speed decreases extremely. (it looks still ok, but this thingi thats rotating there gets pretty slow)
(im running the one from run.cmd)
i don’t think, that a framerate decrease in this rate would be too good :frowning:

bump

How is work going on these new UI API’s?

Xith3D really needs a standard UI package, and those mentioned in this thread seemed promising.

Idealy, once semi-complete these packages could be added to the Xith-tk CVS and distributed along side Xith3D itself.

Will.

+1000

I would label an in-game UI system essential. Xith needs this badly, come on guys, any progress?

Hi

I got a very simple way of drawing swing above the Canvas3D. It only has one little take back: you cannot have transparent or semi transparent ui.
I just simply use a JLayeredPane and add to the parts where I want to have my UI java.awt.Panels, which draw above the Canvas3D. To these Panels I can then add normal Swing-Components.

Arne

  • I don’t know any reason why this should decrease the framerate in any way.

[quote]* I don’t know any reason why this should decrease the framerate in any way.
[/quote]
Good idea, but have you tried it and do the frame rates really stay the same?

I haven’t tried until now, but i think I could be doing that today.

If you get it working please post here :slight_smile:

well i starting looking into this as noted here. and found
that i soon started making 3d objects and texturing
them as others have here. then using Picking for click
events. this is not so cool because its just not good for
any complex controls (popups, drag and drop). it gets
very messy. but it was worth a try. real downer is text
input- u need to add text highlighting when selecting
words, along with copy and paste. if u need all that sort
of controls then you end up making a 3d awt. this is fine
just takes time. layout managers of X, Y and Z is also a
top thing we can do in xith so i’m looking at that also.
skinning is a must have. i dont think eveyone would
want the same look and feel for there buttons as me :slight_smile:
Davids was very cool when he posted the code for the
game he was making- maybe we should look at that.
wonder if he would mind if we ported it into xith these
days?

oh to note- thats why im looking into making a new
file loader. you can then name the objects with there
actioncommands :). maybe also a wast of time but one
has to keep trying and learning the hard way i guess

I don’t think copy/paste is that important at the moment. What is really needed though are just text fields that can accept user info, text boxes that can store chat conversation with a transparent background, etc.

Hi

I’ve checked the different fps now:

with ui: 959.67
with ui without clicking any buttons etc: 1036.53
without ui: 1005.38

for the ui I used a JButton and a JTree. It doesn’t look to bad, does it? :slight_smile:

Here’s the main part of the code:


        JFrame f = new JFrame("ui test");
        f.getContentPane().setLayout(new BorderLayout());
        RenderPeer rp = new RenderPeerImpl();
        CanvasPeer cp = rp.makeCanvas(f.getContentPane(),400, 400, 32, false);
        Canvas3D canvas = new Canvas3D();
        canvas.set3DPeer(cp);
        view.addCanvas3D(canvas);

        f.getLayeredPane().setLayout(new BorderLayout());
        Panel pan = new Panel();
        pan.add(new JButton("click me"));
        pan.add(new JTree());
        f.getLayeredPane().add("South",pan);
        f.setVisible(true);

        view.getTransform().lookAt(
        new Vector3f(0,0,2.41f), //location of eye
        new Vector3f(0,0,0),     //center of view
        new Vector3f(0.0f,1,0.0f));    //vector pointing up
        view.startView();

Arne

Hmm… Nope, can’t see the swing components :frowning:
I’m doing a renderOnce() in a loop instead of startView btw…

f = new JFrame("ui test");
            f.getContentPane().setLayout(new BorderLayout());
            RenderPeer rp = new RenderPeerImpl();
            cp = rp.makeCanvas(f.getContentPane(),800, 600, 32, false);
            Canvas3D canvas = new Canvas3D();
            
            f.getLayeredPane().setLayout(new BorderLayout());
            Panel pan = new Panel();
            pan.add(new JButton("click me"));
            pan.add(new JTree());
            f.getLayeredPane().add("South",pan);
            f.setSize(800, 600);
            f.setVisible(true);

Do you use a Panel instead of a JPanel ??

And try to resize the JFrame at the beginning. It doesn’t draw the Swing at the beginning. I think it has to be updated or something.

Yeah, just like your code says.

did you get my change?

Um… I don’t know what you mean? ???
Hey, could you contact me on AIM or ICQ so that we don’t clutter up this forum?

Pity about the no transparency, this is quite important for some.

IMHO, we just need a simple solution which can create text input and display boxes. At least as a start.

Regarding mouse input, personally I think it would be better not to use picking and instead just convert the coordinates. As this is stricly 2D, I don’t think this will be a problem.

Will.

I think, if we could have transparent heavyweight components (i don’t know any way of doing this :frowning: ), the adding of transparancy wouldn’t be to hard then.

[quote]I think it would be better not to use picking and instead just convert the coordinates.
[/quote]
whats the best way of doing this?