Page 1 of 1

[SOLVED]Help: making a square follow the mouse pointer

Posted: Tue Sep 09, 2014 2:37 pm
by nice
Hello boys and girls!

I need some help with making a square (16x16) follow the mouse pointer, I would appreciate if you could make your explanations detailed.
My project that I'm making (a MS paint clone that I call Helium) is part of my process/project to better understand Lua and it's functions and this project (Helium) is part of the graphical part of Löve.
I have loked around on the Löve forum and other forums for threads that could help me but I haven't found any that helps.

I will attach my project file and I will also make able for you to view my "step by step" goals with this project and feel free to suggest anything that I should add or skip on this project.

I thank you for your time!

Re: Help: making a square follow the mouse pointer

Posted: Tue Sep 09, 2014 4:05 pm
by Plu
Making the square display on the location of the mouse cursor is as simple as doing this:

Code: Select all

-- Draws A 16x16 Square
love.graphics.rectangle("line", x, y, 16, 16)

Re: Help: making a square follow the mouse pointer

Posted: Tue Sep 09, 2014 4:10 pm
by nice
Plu wrote:Making the square display on the location of the mouse cursor is as simple as doing this:

Code: Select all

-- Draws A 16x16 Square
love.graphics.rectangle("line", x, y, 16, 16)
So I dosen't need a local statement?

Re: Help: making a square follow the mouse pointer

Posted: Tue Sep 09, 2014 4:16 pm
by nice
Nevermind, I see it's not needed.
Thanks for your help!