Giter VIP home page Giter VIP logo

Comments (3)

SHEE94 avatar SHEE94 commented on May 18, 2024

目前找到了一个解决办法官方中e.stageY似乎是e.touches[0].clientY坐标乘以2倍,但有做了自己的一套计算方法,最简单的办法就是直接使用e.touches[0].clientY坐标乘以2倍来计算,可以解决ios诗stageY坐标偏移问题

from hilo.

06wj avatar 06wj commented on May 18, 2024

stageX和stageY是在stage坐标系下的,距顶部你应该拿stage.width和stage.height来做对比。
ios和android不同应该是你设置了stage的scale不同吧

from hilo.

SHEE94 avatar SHEE94 commented on May 18, 2024

是只在在stage上监听 的POINTER_MOVE事件,scale安卓和苹果是一致的,理论上只要我的手指直接在stage上滑动,那坐标stageY和stageX坐标是和我的手指一致的,但stageY坐标没有跟随我的手指,而且距离屏幕越远的位置向上移动,到顶部的误差越大```
this.stage.on(Hilo.event.POINTER_MOVE, function (e) {
e.stopImmediatePropagation && e.stopImmediatePropagation();
console.log('hilo',e.stageY)
}.bind(this))

这个事件中是直接获取,手指已经滑倒屏幕之外,但stageY的值却没有到0

from hilo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.