How to add something like menus or text list in JPCT. Urgent

Started by qjvictor, November 10, 2006, 05:59:22 PM

Previous topic - Next topic

qjvictor

Now I am working on a horse racing game using JPCT. Everything goes well. But if I want to add some actions like 'Start','End','Exit' etc to the 3D world,  and the same problem is that I want add start list and finish result boards to it, how should I do?

By the way, how can these menus or buttons be called by mouse event?

Thx

EgonOlsen

Using which renderer? Software, hardware or AWTGLRenderer?

qjvictor

Thanks for your quickly reply.
I copied many codes from the CarApplet demo, I dnt know which renderer.

buffer = new FrameBuffer(width, height, FrameBuffer.SAMPLINGMODE_NORMAL);
buffer.disableRenderer(IRenderer.RENDERER_SOFTWARE);


does it mean it is not software renderer?

And when the users access my applet, a lwjgl.dll will be transferred to the clients.

Melssj5

Nada por ahora

qjvictor


Melssj5

Well, I would recommend you to create a word object that have blitting capabililites from a String and  bounds information. you can use the mouseListener as like in anyother thing to recognize the object but dont expect to add awt or swing objects but you can make your owns.

The Menu is very simple and basic I made a World with a 3DS file that have the options, I also made a selector objec like an arrow so I move the selector when getting a keyboard event. But I guess you need a more sophisticated way.
Nada por ahora

qjvictor

Thanks.
Frankly our horse racing based on JPCT now is perfect except the issues I posted here. (1). use menu or button to control the actions of the race,
(2). need a board to dynamically show the real-time data of the horses.


Do you have some codes for me to have a look, or give me more detail tips?

EgonOlsen

Paradroidz uses two different ways for its ingame GUI elements (if you want to call them like this). One is to use 3d models as a menu, the other is to blit the components out of single textures (or parts of them). You can have a look at the sources here:

http://www.jpct.net/download/paradroidz_src.zip

Interesting for you may be the menu package that uses a 3d model, the overlay package, that uses blitting for some simple (more or less) GUI elements and the transfer package that does some more advanced blitting stuff. If you want events/listeners for clicking buttons like in Swing/AWT, you have to do it yourself. Or just poll the mouse (there's code for this too in the sources). You have to do this anyway even if you add a listener layer on top of it.

qjvictor

I will study the codes first.