Comments (4)
Well it sounds like it's related to retina. What's the size of your view and what's the size of the stage? Maybe view is scaled twice in terms of width and height? If so you need to transform offsets (using view.globalToLocal).
from gestouch.
Thanks a lot for your response and help. Unfortunately, I am not that good with matrix operations or positioning in general when it comes to different devices and DPIs. I tried changing the code by adding
var globalPoint:Point = globalToLocal(new Point(gesture.offsetX, gesture.offsetY));
matrix.translate(globalPoint.x, globalPoint.y);
but I am still not getting the correct results. I did however notice when I change the application DPI from 160 to 240 everything works as expected on the retna display.
Here is the info I am getting for the stage and view dimensions:
Stage: 1536 x 2008
View: 1024 x 1293.66
Thanks again, sorry if this post does not belong here because I think it is an issue on my end and not with your code.
from gestouch.
Well it's a common task, and I should actually add it to examples project.
Haven't tested, but I think it should work:
public static const ZERO_POINT:Point = new Point();// define somewhere
private var globalOffset:Point = new Point();//reuse same instance for better performance
globalOffset.x = gesture.offsetX;
globalOffset.y = gesture.offsetY;
var offsetInThis:Point = this.globalToLocal(globalOffset).subtract(this.globalToLocal(ZERO_POINT));
upd: I would include this functionality in gestures of course, BUT since architecture is not only about flash.display::DisplatObject anymore... This is not that hard to transform stuff after all.
from gestouch.
It is working like a charm! Thanks a ton, both for your help with my problem and for your great work on this library and providing them to us for use!
from gestouch.
Related Issues (20)
- Limit panning in TransformGesture HOT 2
- DoubleTab and zoom HOT 3
- use Gestouch in Normal As3 HOT 1
- Gestouch suddenly stopped working on Windows 10 with latest Animate CC HOT 2
- How can I use gestouch in starling2 and normal swf file with together ? HOT 1
- freerotation behaviour HOT 4
- SwipeGesture and Drag Drop HOT 1
- swipe container and tap with button scaling up HOT 19
- air error HOT 6
- Errors when using swipe gesture with Starling HOT 2
- Starling.dispose() loses Gestouch swipe HOT 3
- Gestouch with Air18 HOT 8
- Gestouch suddenly stops working HOT 7
- Cannot register CLICK events on items inside an item dragged with Gestouch HOT 2
- example for drag and zoom and rotate. all together with gestouch HOT 10
- Listeners not working in certain circumstances HOT 15
- SingleTap and DoubleTap - suggestions? HOT 3
- TUIO and Starling HOT 2
- Shaky TransformGesture HOT 5
- Dispatch SwipeGesture to repeat Event HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gestouch.