Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Mouse help!!!

This thread is locked; no one can reply to it. rss feed Print
Mouse help!!!
vilafranca
Member #8,647
May 2007

Hey everyone!
I'm VERY new to Allegro... I'm a beginner and I still cannot understand most of things! There are only 2 weeks that I began with Allegro, so I'm still lost about it!

I have a work for college that wants us to make a "simple" (for you experts) program that shows a circle in the screen, filled with a certain color (ok, that was easy for me to create this circle and fill it)

But what i really can't do is: they're asking us to make this circle moves when we move the mouse! I mean... it's like the circle is a new mouse cursor, so basically, the circle HAS TO follow the mouse, but i have NO idea how to do that! ???

I've looked for anything I could, but no success! Please, could you help me?! :'(

Thank you so much!

julian_boolean
Member #8,201
January 2007

Just use mouse_x and mouse_y as it's x and y coordinates:

circlefill(buffer, mouse_x, mouse_y, 100, makecol(255, 255, 255));

vilafranca
Member #8,647
May 2007

Oh gosh!
Cooooool!

It worked perfectly!!!
Thank u so much for your help buddy! :D :D :D

julian_boolean
Member #8,201
January 2007

Np. All the mouse related stuff can be found here: http://www.allegro.cc/manual/api/mouse-routines/

Go to: