1
Support / Re: Mouse input offset on the second screen ?
« on: August 25, 2014, 09:33:05 pm »
Okay, figured this out and logging it here for anyone who needs to know this. I can't post exact code due to an NDA but the general idea is, to make this work on the GamePad, go inside of:
tk2dUITouch.cs
Change the following, replace SCREEN_HEIGHT, with the height of your screen.
Doing this converts the touch position into the proper, I think, screen space compared to the mouse position.
I hope this helps someone else!
tk2dUITouch.cs
Change the following, replace SCREEN_HEIGHT, with the height of your screen.
Code: [Select]
public tk2dUITouch(Touch touch) : this()
{
Vector2 tempLoc = new Vector2( touch.position.x, SCREEN_HEIGHT - touch.position.y );
this.phase = touch.phase;
this.fingerId = touch.fingerId;
this.position = tempLoc;
this.deltaPosition = deltaPosition;
this.deltaTime = deltaTime;
}
Doing this converts the touch position into the proper, I think, screen space compared to the mouse position.
I hope this helps someone else!