Hi, I'm overlaying a GUI texture to the position of the mouse. However, the actual click point, the end of the cursor, is off by a little to the left and up of my actual texture. How do I fix this?
Here's my script:
asked Aug 02 '10 at 08:47 PM
You need to offset the rect by half the width and height:
var pos : Rect = Rect(mousePos.x - cursorImage.width / 2.0, Screen.height - mousePos.y - cursorImage.height / 2.0, cursorImage.width, cursorImage.height);
answered Aug 02 '10 at 09:20 PM