Hi,
I just noticed something troubling. I noticed some jumpiness of the image movements, kinetic tests, etc. that are happening as a result of touches, so I did some digging and found this:
When I print touch event coordinates - they are all rounded (no decimal part).
Gideros application content size can be a lot smaller than the screen size - depending of the current device resolution.
Gideros is nicely built so that it converts all coordinates from the global coordinate system of the device to the application coordinate system (and v.v.).
This does not seem to be the case for touch coordinates - the touch coordinates are indeed converted to the local coordinate system, BUT are rounded up resulting incorrect and jumpy responses.
I am pretty sure I tested this before with older version of Gideros and this was not the case, but may be I am wrong.
I haven't noticed this jumpiness and incorrect (kinetic and move) behavior in older tests, so I thought I world ask.
Am I doing something wrong when getting the coordinates from the event? If so could you please tell me how to get the real non-rounded touch coordinates?
Or is Gideros indeed rounding them up. If so I would like know why and if this can possibly change?
If it is impossible to get real touch coordinates, could you tell me when did this change so that I can downgrade to older version of Gideros (provided that I am not wrong of course and this was working fine before)?
Thanks a lot for your help.
Vlad
Comments
1. If I have an object following my finger it jumps every 4 pixels.
2. If I do a kinetic scrolling (which is very easy to do with Gideros by just remembering the final "speed" of the finger based on touch event coordinates and then feed it to the frame callback with some coefficient). This is no longer working correctly since the speed is not precise.
2. don't really understand what is a kinetic scroll, can you provide an example?
When Gideros converts coordinates from the physical to logical dimension it uses FLOATING POINT numbers with a lot of precision.
BUT when it converts touch coordinates it uses INTEGER number loosing a lot of precision (I know lua uses floating point internally, but these are rounded to integer)
This was not the case before.
There were several optimizations of the touches in Gideros in the last several releases. I think it is one of them that rounded the touch coordinates, but I can't be sure without downloading old releases, installing them and printing the touch coordinates.
As for the kinetic scroll: This is simply when you swipe your finger over your zoomed scene (or scrollable list) it moves on its own for awhile until it slowly stops. This simple thing is not workig well when there is no precision in the touch coordinates.
I can add two extra fields to mouse/touch events to provide unrounded coordinates like event.rx and event.ry (I cannot decide the name and I'm open to suggestions)
If you could do that - this will make the touch game play much smoother for bigger devices.
I was actually printing all event table elements trying to find something like rx and ry and use it.
"rx" and "ry" sound good to me. That is what I would use...
Likes: plamen
You are the best!
Try the vertical columns of apps, with finger still touching, and scroll... it's not smooth like it used to be in all pervious scrolling of the app store. This is not a performance issue, as the moment you lift your finger the momentum scrolling is flawlessly smooth, it's something to do with the reading of or crunching of the touch data, I think.
What you're describing, @kussakov - a rounding of a screen space significantly less than the resolution on iPad Retina, might be what's going on. It annoys me, no end, as I spend an inordinate amount of time browsing apps.
Try the settings menu on your iPad, or the Notifications menu (mines LONG) and you'll see it stutter when your finger is on the screen, but goes back to how smooth it was prior to iOS 6 the moment you release your finger and the inertia part takes over.
It's as though they're either sampling the touch's slide at a really low frame rate, or the touch position is being rounded as you're describing and that's causing a "stutter".