www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: kiffa on July 31, 2013, 07:32:29 am

Title: How to effectively implement GUI with jPCT-AE?
Post by: kiffa on July 31, 2013, 07:32:29 am
GUI means menu\button\dash board\HP-bar and so on,  they are 2D images in most case.

I have tried 2 methods:
  1, Use Android GUI mechanism: This is simple, but will be slow when the view(s) need to update frequently(send msg to UI-Thread, then measure\layout\draw the View-hierarchy.)

 2, Use FrameBuffer.blit(): Need to code yourself for some special effects, and seems to be not very fast(Maybe I used it in a wrong way).

My question:
  1, Could you explain the implementation of FrameBuffer.blit()? And how fast should it be?

  2, Is there a third way? The performance is the most important factor  to me.
Title: Re: How to effectively implement GUI with jPCT-AE?
Post by: kiffa on July 31, 2013, 07:48:31 am
I have made a racing game, and need update  the dash board frequently, e.g: the current speed of player, the current ranking of player, the current score of player, the current time of race and so on.

I use Android-GUI for this now,  it works fine for static views, but slowly for views which update frequently.  After measuring, the updating of GUI was one of the bottlenecks. I have controlled the rate of updating, but the performance was also not good enough.


Title: Re: How to effectively implement GUI with jPCT-AE?
Post by: EgonOlsen on July 31, 2013, 08:00:33 am
Blitting is as fast as it gets and i've never seen any impact on performance when using it. For example in this scene

(http://jpct.de/jpctnet/img/rpg_and52.png)

The dialog window itself consists of several blits and each character of the text is a single blit and i don't see any performance impact from it.
Title: Re: How to effectively implement GUI with jPCT-AE?
Post by: kiffa on July 31, 2013, 08:36:03 am
Thanks, I will try blit and be back soon.
Title: Re: How to effectively implement GUI with jPCT-AE?
Post by: Thomas. on July 31, 2013, 10:55:19 pm
Or you can get inspired by my GUI (maybe it will be sometimes for download...) ;)

(http://s8.postimage.org/ltr9kd5kh/device_2012_12_28_224107.jpg) (http://postimage.org/image/ltr9kd5kh/) (http://s8.postimage.org/6gr9lwzo1/device_2013_01_16_203219.jpg) (http://postimage.org/image/6gr9lwzo1/) (http://s8.postimage.org/am6rlkmtt/device_2013_01_16_202235.jpg) (http://postimage.org/image/am6rlkmtt/) (http://s1.postimage.org/v1it2c3hn/device_2013_01_30_211810.jpg) (http://postimage.org/image/v1it2c3hn/) (http://s17.postimage.org/conlfc3qz/device_2013_02_02_215932.jpg) (http://postimage.org/image/conlfc3qz/) (http://s20.postimg.org/hu1dw5d2x/device_2013_05_24_172703.jpg) (http://postimg.org/image/hu1dw5d2x/)
Title: Re: How to effectively implement GUI with jPCT-AE?
Post by: Yerst on August 03, 2013, 06:17:27 pm
@Thomas.: What were you using to do this?
Title: Re: How to effectively implement GUI with jPCT-AE?
Post by: Thomas. on August 03, 2013, 08:23:18 pm
For graphics part is used only FrameBuffer.blit(...), but control of menu itself is little bit complex. I am used recursive algorithm.