Author Topic: Need some GUI help  (Read 980 times)

Offline adenaman

  • byte
  • *
  • Posts: 3
    • View Profile
Need some GUI help
« on: May 20, 2012, 11:38:00 am »
Hi
Im a new user of this engine and i lack a lot of experience with grafic engines or android development, but i want to thank you for this engine and say that its easier to use than expected ( at least till now xD)
I have some questions to you:

- user GUI: i want to have my world in the background that is represented in the camera and over this i would like to have a 2dWorld with the user interface, those are some buttons or some text panel , in some guides that i saw ppl used blit() but that is only some pixel painting , i would like to know if there are something more advanced.

- is there some way to know at what point of the 3dObject i have clicked, at what object but and where at that object

Thank you

Online EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11745
    • View Profile
    • http://www.jpct.net
Re: Need some GUI help
« Reply #1 on: May 20, 2012, 09:55:10 pm »
To answer your questions:

  • jPCT-AE is a 3d engine. It's not a GUI toolkit. There's no direct support for anything GUI-related. I guess most people rely on blit and use somekind of homebrew GUI classes
  • Yes. It's possible to detect the point in space where the clicked hits the object and it's also possible to get the polygon that you've hit. It depends which information you actually need!?

Offline adenaman

  • byte
  • *
  • Posts: 3
    • View Profile
Re: Need some GUI help
« Reply #2 on: May 21, 2012, 02:12:46 am »
One of my problems is that i dont know what to expect from the device capacity

1. If i find any 2d engine / GUI toolkit can i try to post-render the screen with another engine, and the most important, it will be stable and fast enought?

2. what im trying to do is some kind of chess game, and i need to know where on the table did the player clicked to move, i can create every box like a new object or all the board like 1 object and then calculate where he want to move. If i want to make it shine where is possible to move then i should to it separately?

Thank you

Offline adenaman

  • byte
  • *
  • Posts: 3
    • View Profile
Re: Need some GUI help
« Reply #3 on: May 22, 2012, 08:17:56 am »
One more thing, is there any way to keep some pixels without a need to draw them evey frame? i mean at the moment i am painitg the whole screen no matter if it changes or not, i think android has something for this invalidate() but can i use it here?

Online EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11745
    • View Profile
    • http://www.jpct.net
Re: Need some GUI help
« Reply #4 on: May 22, 2012, 08:55:15 pm »
No. You have to redraw it in each iteration of onDrawFrame. You can however control if onDrawFrame should be called in fixed intervalls (default) or only when the surface is decleared dirty. See GLSurfaceView.setRenderMode(...) for more details.