Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Drysteven

Pages: [1]
1
Window / Re: Different Window Sizes
« on: August 18, 2016, 04:41:30 pm »
.intersects takes a rect so will use all four members (including left and top).
The question here is what is "mouse"? Is it a rectangle?

Yes, mouse is a 1 pixel by 1 pixel rectangle that I set to always be at the mouse coordinates.

2
Window / Re: Different Window Sizes
« on: August 18, 2016, 07:22:48 am »
As well as the co-ordinate conversion advice given by G, be aware that a similar symptom could be caused by mistakingly using local bounds instead of global bounds.

Use global bounds and convert them :)

Note: don't forget the left and top values of the bounds. This is especially important for text.

This is the line I am using to test for the box over the mouse, mouse, intersects the play text, play.

if (mouse.intersects(play.getGlobalBounds()) == true)

How would I add top and left in this. Would I have to make something with if play.getGlobalBounds().x, play.getGlobalBounds().y, play.getGlobalBounds().top, play.getGlobalBounds().left? If so can you please give me an example of how to do this. Thank you.

3
Window / Different Window Sizes
« on: August 17, 2016, 06:35:56 am »
I am currently trying to make text in the window and then make the text clickable by the user and I have successfully done this, but if I change the window size then it only detects a click when it is in the top left corner and not on the right or bottom of the text. I made it so that the text relative to the background which placed it in the right spot I need to know how to change the size relative to the resolution or if there is a much easier way of doing text click detection on text. I am using a small box set to the mouse's coordinates and then testing if it is on the text. Thank you for reading.

Pages: [1]
anything