Hi, just bought your windows7 touch asset from the store and there seems to be a problem with some of the code.
I’m getting the following errors:
Assets/W7Touch/NGUI/UICameraW7Touch.cs(41,46): error CS0122: `UICamera.GetTouch(int)’ is inaccessible due to its protection level
Assets/W7Touch/NGUI/UICameraW7Touch.cs(54,54): error CS0122: `UICamera.Raycast(UnityEngine.Vector3, ref UnityEngine.RaycastHit)’ is inaccessible due to its protection level
Assets/W7Touch/NGUI/UICameraW7Touch.cs(62,37): error CS0122: `UICamera.RemoveTouch(int)’ is inaccessible due to its protection level
Assets/W7Touch/NGUI/UICameraW7Touch.cs(102,30): error CS0122: `UICamera.ProcessTouch(bool, bool)’ is inaccessible due to its protection level
first of all, thank you for developing this! I just bought it, how do I apply the NGUI.patch, I get same errors like Bjerre… I’m using unity3.5.5f2 pro on mac and ngui.
Maybe you could give me a little example how do I process touches from GetTouch, it would be very nice
Sorry, I forgot to include some patching instructions. I’m updating the readme.txt with some instructions, and I put them here too. I’m also making a video tutorial to use it with NGUI.
Patching is a very standard process, you can find several tools on the internet, o apply it manually.
If you use some kind of version control, like TortoiseSVN, right clicking on the .patch file has a submenu to apply it. If it asks, use the suggested path.
If you prefer to do it manually, the .patch file is just plain text, with lines to be removed marked with a minus sign, and lines to be added marked with a plus. Line numbers and the other lines are for context, so you can know where to replace.
Or you can make the modifications yourself, by making the following methods public (add “public” to the beginning of the line): Raycast, GetTouch, RemoveTouch and ProcessTouch
and adding this line
You can find an example of use in the UICameraW7Touch.cs file, in the ProcessInput method, which is used for the NGUI integration. Maybe is a little complex and has too many NGUI related code, but I hope it helps.
There is an API to get the touches, so you can use it without NGUI. The W7TouchManager class has the API to access the touches, and you can use UICameraW7Touch as an example of how to process the touches.
That’s great that someone is adding needed functionality for us multi-touch developers.
But actual touch/gestures recognition is much more than just getting WM_TOUCH events. And it’s wrong to say that TUIO is worse than win7 touch. There are cases when TUIO is a much better solution.
I am a multi-touch feveloper myself. And here’s (mostly) my open-source library which is much more than just touch recognition.
I believe that adding WM_TOUCH events is just a matter of time for Unity team because of Windows 8. If right now only a dozen of people need this functionality, with Windows 8 it will be a common request.
Our package does more than getting WM_TOUCH events, thats where the NGUI integration comes into play. Single finger (press, release, click, double click) is handled to the NGUI event system and some two finger gestures are implemented also (scroll, rotate, and drag).
We intentionally left the possibilty to read raw touches to integrate with other touch gestures libraries or custom solutions.
By the way, our solution does work inside the editor and is stable. Replacing the WndProc is not the best solution, but if you want to know how we do it, you’ll have to buy the package.
I understand that. We just didn’t need it at that time.
If you want an integration with something like NGUI you can fork the lib and write it yourself. We don’t use NGUI so we don’t need it.
1: I go to run and I get this stupid NGUI thing, I do not have or want NGUI I am using Scaleform, I only want to deal with the touches responsively.
2: It will not run: I get this error… Host has not Windows 7, it has: ‘Microsoft Windows NT 6.1.7601.0’ also, check if the screen is touch capable
3: I do not have the touch screen as my developer envirionment, The touch screen is somewhere else, another floor in the building. I am going to then send it to a client. I am on a Windows 7 machine, but not with a touch screen.
I tried out your library (sample project included) - look’s very nice and all gestures running very smooth, the touch recognition is very fast - great work!
My problem is, I’m not very advanced in programming and I’m programming in javascript/unity script not in c#. Can I use your library with unity script, if so can you please post a sample code? I would like to use the scale gesture, but I need to define min and max scale factor for scalable objects.
We should send you the $50 thanks man, your library saved asses this weekend. If anything good came from purchasing Win7 Multitouch its that I found your stuff.