(Solved) Figuring out the position with Y and X
(Solved) Figuring out the position with Y and X
I have been struggling with figuring out the position for x and y. And I do not know how to know the exact position of the screen where to put it. I always play around till I have the good positions
Last edited by Stepper on Fri Jul 13, 2012 1:28 pm, edited 1 time in total.
Re: Figuring out the position with Y and X
Try this, it will tell you what x and y position your mouse is at!
Code: Select all
function love.draw()
-- Put other things here!
love.graphics.print('x: '..love.mouse.getX(), 8, 8)
love.graphics.print('y: '..love.mouse.getY(), 8, 20)
end
Re: Figuring out the position with Y and X
What if I am also coding for other langauges? How do I do that?
THANKS, Also, it works great.
THANKS, Also, it works great.
Re: Figuring out the position with Y and X
I don't quite understand what you mean sorry. Do you mean how would you find the X and Y positions in other languages? If so, you could:
Sorry if I've misunderstood!
- Find out how to print text to the screen
- Find out how to get the x and y position of the mouse
- Print the numbers of the x and y position of the mouse to the screen
Sorry if I've misunderstood!
Re: Figuring out the position with Y and X
Tried it, and thanks. I just did it in Java and C++.
Who is online
Users browsing this forum: No registered users and 6 guests