gnope php gtk gui gnope.org  

Animated sprites in PHP-GTK2

 
Post new topic   Reply to topic    gnope.org Forum Index -> Announcements
View previous topic :: View next topic  

these animations run (...) on my system
fluid
100%
 100%  [ 1 ]
choppy
0%
 0%  [ 0 ]
Total Votes : 1

Author Message
tulpe



Joined: 06 Sep 2006
Posts: 7

PostPosted: Wed Jan 10, 2007 6:24 pm    Post subject: Animated sprites in PHP-GTK2 Reply with quote



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 Smile


Oh.. and happy new year! Razz

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 Razz


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

PostPosted: Wed Jan 10, 2007 10:15 pm    Post subject: Re: Stupid little GTK2 programm that draws falling flowers.. Reply with quote

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

PostPosted: Wed Jan 10, 2007 11:06 pm    Post subject: Re: Stupid little GTK2 programm that draws falling flowers.. Reply with quote

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

PostPosted: Thu Jan 11, 2007 9:33 am    Post subject: Re: Stupid little GTK2 programm that draws falling flowers.. Reply with quote

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

PostPosted: Fri Jan 12, 2007 2:59 am    Post subject: Reply with quote

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

PostPosted: Fri Jan 12, 2007 1:30 pm    Post subject: Reply with quote

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

PostPosted: Fri Jan 12, 2007 4:24 pm    Post subject: Reply with quote

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

PostPosted: Sat Jan 13, 2007 4:01 pm    Post subject: Reply with quote

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

PostPosted: Sat Jan 13, 2007 9:37 pm    Post subject: Reply with quote



wow.. looks like php/gtk2 handles even 3x parallax scrolling without a problem! Laughing

marioworld.zip 16kb
Back to top
mq



Joined: 25 Nov 2006
Posts: 12

PostPosted: Tue Jan 16, 2007 11:33 pm    Post subject: Reply with quote

tulpe wrote:

wow.. looks like php/gtk2 handles even 3x parallax scrolling without a problem!

very nice work Smile
Back to top
syn



Joined: 12 May 2006
Posts: 46
Location: Hamburg

PostPosted: Wed Jan 17, 2007 8:02 pm    Post subject: Reply with quote

cool!!!! very cool!
Back to top
Display posts from previous:   
Post new topic   Reply to topic    gnope.org Forum Index -> Announcements All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Templates enhanced by DigiWiki. Hosting by Tradebit.