Hello Guest

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 - gtsphere

Pages: [1]
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.

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!

2
Support / Re: Mouse input offset on the second screen ?
« on: August 25, 2014, 08:39:10 pm »
So here is some interesting stuff, inside of "tk2dUIManager.cs" I put in two debug logs, inside of:

Code: [Select]
   
tk2dUIItem RaycastForUIItem( Vector2 screenPos ) {
        int cameraCount = sortedCameras.Count;
        for (int i = 0; i < cameraCount; ++i) {
            tk2dUICamera currCamera = sortedCameras[i];
            if (currCamera.RaycastType == tk2dUICamera.tk2dRaycastType.Physics3D) {

Debug.Log("Input mouse position: " + Input.mousePosition);
Debug.Log ("Ray touch position: " + screenPos);
...

And here are the results, when running the "UI Demo" itself on the Wii U gamepad:

Top LEFT Corner (touching as far top right as possible with the stylus):
Input mouse position: (8.7, 472.0, 0.0)
Ray touch position: (8.7, 8.0)

Top RIGHT Corner:
Input mouse position: (846.0, 472.0, 0.0)
Ray touch position: (846.0, 8.0)

Bottom LEFT Corner:
Input mouse position: (8.0, 8.0, 0.0)
Ray touch position: (8.0, 472.0)

Bottom RIGHT Corner:
Input mouse position: (846.0, 8.0, 0.0)
Ray touch position: (846.0, 472.0)

Tapping the "Up Down Button" itself directly in the middle:
Input mouse position: (291.6, 321.3, 0.0)
Ray touch position: (292.2, 159.3)
 ** Note: The button did NOT respond to this touch

Tapping the complete opposite area of the "Up Down Button" on the Y axis (slightly above the "On" button) to show that the offset of the button is down there, doing this DID make the "Up Down Button" respond to the touch and it did register it:
Input mouse position: (272.2, 173.3, 0.0)
Ray touch position: (272.2, 306.7)

Hopefully this all makes sense, but you can see that there is a difference in the Y axis between the touches of what is considered the "mousePosition" versus the finger touch within ray casting.

I'm going to keep digging but hopefully this rings some bells.

Thank you!

3
Support / Re: Mouse input offset on the second screen ?
« on: August 25, 2014, 08:07:52 pm »
I am seeing this exact issue with the latest version of tk2d and 4.3 Unity (WiiU) build. It appears the input is, for lack of better description, a mirror opposite of where you would press. So imagine a button at the top right corner, touching the bottom right corner, makes it "tap". I am digging now to see what Input.mousePosition says but I have a feeling something is inverted somewhere... I'll be back with more details but any ideas are more than welcomed!

4
Support / Re: Solution to tk2dUITextInput scale problem
« on: January 11, 2014, 04:17:39 am »
I believe I just figured it out.

Rather than scaling the Unity transform, scale individual components of the text input component using the 2D Toolkit "Scale" setting.
eg, the Scale fields on the various tk2dSlicedSprite and tk2dTextMesh components that make up a text input. You may need to manually adjust the local position of the text components a little after scaling.

On the tk2dUITextInput, ensure you increase the Field Length to match your text input - there's a gizmo showing the field length in the Scene view to help.
Make sure you also resize the collider. The quick way is to click on the Collider - Automatic Fit - "Fit" button (on the text inputs tk2dUIItem).

That seems to do it. Now back to making my highscore entry UI  ;D

Thank you!  This definitely did the trick, working just great now!

5
FAQs / Re: Register your copy and get download access.
« on: October 03, 2013, 01:02:44 pm »
Just wanted to poke my head in to see if there was any ETA.  No rush! I know it's a manual process, just was curious! 

Thank you!

Pages: [1]