Author Topic: How to add something like menus or text list in JPCT. Urgent  (Read 6180 times)

Offline qjvictor

  • int
  • **
  • Posts: 77
    • View Profile
How to add something like menus or text list in JPCT. Urgent
« on: November 10, 2006, 05:59:22 pm »
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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
How to add something like menus or text list in JPCT. Urgent
« Reply #1 on: November 10, 2006, 07:10:07 pm »
Using which renderer? Software, hardware or AWTGLRenderer?

Offline qjvictor

  • int
  • **
  • Posts: 77
    • View Profile
disableRenderer(IRenderer.RENDERER_SOFTWARE)
« Reply #2 on: November 10, 2006, 07:28:04 pm »
Thanks for your quickly reply.
I copied many codes from the CarApplet demo, I dnt know which renderer.
Code: [Select]

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.

Offline Melssj5

  • double
  • *****
  • Posts: 724
    • View Profile
How to add something like menus or text list in JPCT. Urgent
« Reply #3 on: November 10, 2006, 08:23:48 pm »
:x  :x  :x  :x  :x  :x  :x
Nada por ahora

Offline qjvictor

  • int
  • **
  • Posts: 77
    • View Profile
say something
« Reply #4 on: November 10, 2006, 08:25:03 pm »
anybody can help me

Offline Melssj5

  • double
  • *****
  • Posts: 724
    • View Profile
How to add something like menus or text list in JPCT. Urgent
« Reply #5 on: November 10, 2006, 08:38:10 pm »
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

Offline qjvictor

  • int
  • **
  • Posts: 77
    • View Profile
Thanks, but...
« Reply #6 on: November 10, 2006, 08:46:24 pm »
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?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
How to add something like menus or text list in JPCT. Urgent
« Reply #7 on: November 10, 2006, 09:19:47 pm »
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.

Offline qjvictor

  • int
  • **
  • Posts: 77
    • View Profile
Thanks a lot
« Reply #8 on: November 10, 2006, 09:29:13 pm »
I will study the codes first.