| View previous topic :: View next topic |
| these animations run (...) on my system |
| fluid |
|
100% |
[ 1 ] |
| choppy |
|
0% |
[ 0 ] |
|
| Total Votes : 1 |
|
| Author |
Message |
tulpe
Joined: 06 Sep 2006 Posts: 7
|
Posted: Wed Jan 10, 2007 6:24 pm Post subject: Animated sprites in PHP-GTK2 |
|
|
Just a simple test to see how fast php/gtk2 handles the positioning of elements (sprites) on a GtkFixed widget.
Press key up/down to increase/decrease amount of flowers.
Guide the flowers with the mouse.
On my windows box this looks pretty fluid.. would like to hear how it performs under linux/osx.
http://atomar.de/php_gtk2/flowers/flowers.phpw
Enjoy
Oh.. and happy new year!
Edit: now with wind =P
Note: I changed the thread title from "Stupid little GTK2
programm that draws falling flowers.." to the current one.
I will post some additional experiments about the topic here.
Oops.. the poll was merely a test.. i thought i could delete it later
Last edited by tulpe on Tue Jan 16, 2007 10:46 am; edited 10 times in total |
|
| Back to top |
|
 |
mq
Joined: 25 Nov 2006 Posts: 12
|
Posted: Wed Jan 10, 2007 10:15 pm Post subject: Re: Stupid little GTK2 programm that draws falling flowers.. |
|
|
| tulpe wrote: | Just a simple test to see how fast php/gtk2 handles the positioning of elements (sprites) on a GtkFixed widget.
On my windows box this looks pretty fluid.. would like to hear how it performs under linux/osx.
|
really nice and fast ; thanks. I'm thinking about an object oriented version of this application if you agree.
it's really fast on my linux computer (3ghz CPU). It seems really faster than this demo : http://www.php-gtk.eu/code-snippets/christmas-stars-object-oriented-tutorial-in-php-gtk2 |
|
| Back to top |
|
 |
tulpe
Joined: 06 Sep 2006 Posts: 7
|
Posted: Wed Jan 10, 2007 11:06 pm Post subject: Re: Stupid little GTK2 programm that draws falling flowers.. |
|
|
| mq wrote: | really nice and fast ; thanks. I'm thinking about an object oriented version of this application if you agree.
|
sure go ahead, that would have been the next thing for me to try out.
tell me if it hurts performance to do this oo in php |
|
| Back to top |
|
 |
mq
Joined: 25 Nov 2006 Posts: 12
|
Posted: Thu Jan 11, 2007 9:33 am Post subject: Re: Stupid little GTK2 programm that draws falling flowers.. |
|
|
| tulpe wrote: |
sure go ahead, that would have been the next thing for me to try out.
tell me if it hurts performance to do this oo in php |
please have a look here : http://php-gtk.pastebin.ca/312837
if you agree with me, I will post an article about this code in http://www.php-gtk.eu/ |
|
| Back to top |
|
 |
firepages
Joined: 09 Jan 2007 Posts: 4
|
Posted: Fri Jan 12, 2007 2:59 am Post subject: |
|
|
| wow, on ubuntu here that a)fly's & b)rocks , excellent example , great sooth acceleration. |
|
| Back to top |
|
 |
tulpe
Joined: 06 Sep 2006 Posts: 7
|
Posted: Fri Jan 12, 2007 1:30 pm Post subject: |
|
|
i've updated the script
flowers now get colored in a random hue.
left/right arrows now control wind strength/direction
@mq agreed |
|
| Back to top |
|
 |
tulpe
Joined: 06 Sep 2006 Posts: 7
|
Posted: Fri Jan 12, 2007 4:24 pm Post subject: |
|
|
| by the way.. does anyone know if its possible to change the z-index of things on a GtkFixed once they are added? |
|
| Back to top |
|
 |
mq
Joined: 25 Nov 2006 Posts: 12
|
Posted: Sat Jan 13, 2007 4:01 pm Post subject: |
|
|
| tulpe wrote: | | by the way.. does anyone know if its possible to change the z-index of things on a GtkFixed once they are added? |
you could override GtkFixed class to manage elements. Now it seems to be impossible. You just have 2 methods to add and remove sub objects.
It's probably possible to have a look at GtkFixed source code and change if possible some attributes directly, else, need to do much and you will have some performance drawback. |
|
| Back to top |
|
 |
tulpe
Joined: 06 Sep 2006 Posts: 7
|
Posted: Sat Jan 13, 2007 9:37 pm Post subject: |
|
|
wow.. looks like php/gtk2 handles even 3x parallax scrolling without a problem!
marioworld.zip 16kb |
|
| Back to top |
|
 |
mq
Joined: 25 Nov 2006 Posts: 12
|
Posted: Tue Jan 16, 2007 11:33 pm Post subject: |
|
|
| tulpe wrote: |
wow.. looks like php/gtk2 handles even 3x parallax scrolling without a problem!
|
very nice work  |
|
| Back to top |
|
 |
syn
Joined: 12 May 2006 Posts: 46 Location: Hamburg
|
Posted: Wed Jan 17, 2007 8:02 pm Post subject: |
|
|
| cool!!!! very cool! |
|
| Back to top |
|
 |
|