fehaar / FFWD

This is the FFWD framework for XNA, that allows you to port Unity3D games to XNA for use on WP7 or XBox360 (XBLIG)
Microsoft Public License
133 stars 36 forks source link

TouchPhase not working??? #53

Open stanleyjoy opened 12 years ago

stanleyjoy commented 12 years ago

I used this code found in the Unity Script Reference to get a basic drag and translate. The code is placed in the Update method. I know touchCount works. But touch phase???

if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Moved) { Vector2 touchDeltaPosition = Input.GetTouch(0).deltaPosition; transform.Translate(-touchDeltaPosition.x * speed, -touchDeltaPosition.y * speed, 0); }

Here is the link to the unity reference http://unity3d.com/support/documentation/ScriptReference/Input.GetTouch.html Stan

stanleyjoy commented 12 years ago

no response in 5 days!! Looks like you are really busy.. Any how, I found that only TouchPhase.Begin is recognized but the rest just not respond at all what so ever. The began phase fires every time my finger is on the screen. Hope this can be fixed easily Stan

fehaar commented 12 years ago

Yes. I have been to the Nordic Game conference and we had a long weekend here in Denmark. The Touch classes should be working, we are using them in our game.

The TouchPhase is set in Input.cs in lines 68-136. Can you try to debug and see why it is not working. It is important to note that Touch will probably only work properly on a WP7 device. I am not sure that it works in the emulator.

BTW you should put your input related code in FixedUpdate

stanleyjoy commented 12 years ago

The current code will work as expected if I use Touchphase.Began in the emulator. However in the device it has some issues.

Stan P.S. Lucky bugger, you went for the Nordic Game Conference

fehaar commented 12 years ago

Interesting... I will try it out to see what is going on.

Nordic Game was a blast.

stanleyjoy commented 12 years ago

I am right now busy with some update work. Will get back to this in 2 days. Stan

stanleyjoy commented 12 years ago

I found the issue but it comes with a price. Remember a while back when gamekingdom posted a issue where the GUI.Button used to work in the emulator but did not work in the device, which he solved by changing a small 'if' condition. If you don't remember check this out https://github.com/fehaar/FFWD/issues/34#issuecomment-5683186 When I reset the input.cs to the old default way. The touchphase started working again with the loss of button functionality.

fehaar commented 12 years ago

Ah.... So we have to find a solution that fits both ways. Thanks for the find.

stanleyjoy commented 12 years ago

so any ideas??? Stan

fehaar commented 12 years ago

Not before I have time to look at the code. Sorry.

stanleyjoy commented 12 years ago

Any Luck bro Stan

fehaar commented 12 years ago

I am extremely busy with getting another title not using FFWD out the door, until that happens, I have no time to spare. Sorry.

stanleyjoy commented 12 years ago

Sorry to bug you. Give a heads up when you are free. Stan

stanleyjoy commented 12 years ago

After 6 days, dare I ask you if you are free???

stanleyjoy commented 12 years ago

13 Days and counting!!!

stanleyjoy commented 11 years ago

I am still not getting the touchPhase.Moved to work.

stanleyjoy commented 11 years ago

After applying the fix the touchPhase was working on the emulator correctly and perfectly. However in the phone it just fires Stationary and ended always. Stan