# Animation using gnome 2

**URL:** <https://www.ruby-forum.com/t/animation-using-gnome-2/132133>\
**Category:** Ruby-Gnome 2\
**Created:** [March 17, 2008, 10:56am UTC](https://www.ruby-forum.com/t/animation-using-gnome-2/132133 "2008-03-17T10:56:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kn0t](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/59ef9b/32.png) [@kn0t](https://www.ruby-forum.com/u/kn0t)\
**Post date:** [March 17, 2008, 10:56am UTC](https://www.ruby-forum.com/t/animation-using-gnome-2/132133/1 "2008-03-17T10:56:32Z")

</div>

Hi,  
Does anyone know where to find example code or a tutorial to do simple  
animations using ruby? E.g. making an object slide from one point of a  
screen to another

---

<div class="post-metadata">

**Author:** ![kn0t](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/59ef9b/32.png) [@kn0t](https://www.ruby-forum.com/u/kn0t)\
**Post date:** [March 17, 2008, 1:53pm UTC](https://www.ruby-forum.com/t/animation-using-gnome-2/132133/2 "2008-03-17T13:53:07Z")

</div>

> Hi,  
> Does anyone know where to find example code or a tutorial to do simple  
> animations using ruby? E.g. making an object slide from one point of a  
> screen to another

You could use Canvas and put a rect on it, and slide it to the right  
side 🙂

I am not sure if this is possible with Images too, but I think it is  
somehow.

---

<div class="post-metadata">

**Author:** ![kn0t](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/59ef9b/32.png) [@kn0t](https://www.ruby-forum.com/u/kn0t)\
**Post date:** [March 17, 2008, 4:46pm UTC](https://www.ruby-forum.com/t/animation-using-gnome-2/132133/3 "2008-03-17T16:46:44Z")

</div>

Am Montag, den 17.03.2008, 10:56 +0100 schrieb Foo Gwen heong:

> Hi,  
> Does anyone know where to find example code or a tutorial to do simple  
> animations using ruby? E.g. making an object slide from one point of a  
> screen to another

Hi,

can you specify what you want to do?

Do you think about something like xpenguin, where a shaped window goes  
around the screen? Then look at Gtk::Window.move

If you want an image or some widgets go around in an other window, look  
at Gtk::Fixed.

If you want an image only slide in an other window, so you can see  
different parts of it, look at Gtk::ScrolledWindow. To move it around  
just update the associated Gtk::Adjustment(s).

You could also blit your Image as a Gdk::Pixuf onto a Gtk::Drawable.  
Also the usage of Cairo is possible.

Cheers, detlef
