CreateJs Canvas's shape losses its co-ordinates on Windows Phone

十年热恋 提交于 2019-12-08 03:57:47

问题


am making a Createjs and html5 project in which I am drawing a shape(Red circle), when I click over the circle it gives alert. It works fine on all desktops and android phones. Except when I open this in a windows phone it works fine on the normal screen but when I zoom the screen it loses it working, an alert is shown when I click anywhere on the screen(maybe where the co-ordinates of the shape resides) but not when I click over the shape(Circle),, Your help is appreciated

my demo.html

 <!DOCTYPE html>
    <html>
    <head><title></title>
    <script type="text/javascript" src="createjs-2013.12.12.min.js"></script>
    <script type="text/javascript" src="jquery-1.11.0.min.js"></script>
    <script type="text/javascript">
        function init() {
                var stage = new createjs.Stage("demoCanvas");
                var circle = new createjs.Shape();
                createjs.Touch.enable(stage);
                circle.graphics.beginFill("red").drawCircle(0, 0, 50);
                circle.x = 100;
                circle.y = 100;
                circle.addEventListener("click", function(evt) { /*$("span#log").text(circle.x);*/ alert('clicked'); });
                stage.addChild(circle);
                stage.update();

         }
    </script>
    </head>
    <body onLoad="init();">
        <span id="log"></span>
        <br>
        <canvas id="demoCanvas" width="500" height="300">
            alternate content
        </canvas>

    </body>
    </html>..

Here's the project


回答1:


Not sure if this is relevant as haven't looked at sample code, but I think createjs.Touch.enable works on Stage instances rather than DisplayObjects

See here




回答2:


I do alot of Research over this topic, and at the end i came to this point that this the BUG in IE11 . Hope Microsoft helps to solve this.



来源:https://stackoverflow.com/questions/23335111/createjs-canvass-shape-losses-its-co-ordinates-on-windows-phone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!