jaevelgames Posted April 29, 2015 Share Posted April 29, 2015 Hi! Not sure if I'm doing something wrong here, but I can't figure it out.. I got this in my index.html:<script type="text/javascript"> var windowWidth = window.innerWidth; var windowHeight = window.innerHeight; var scale = windowWidth / 320; PIXI.SCALE_MODES.DEFAULT = PIXI.SCALE_MODES.NEAREST; var renderer = new PIXI.autoDetectRenderer(windowWidth, windowHeight, {backgroundColor : 0xecc52b}); document.body.appendChild(renderer.view); stage = new PIXI.Container(); stage.scale.set(scale); stage.interactive = true; stage.tap = function(){ console.log('Test click') } function sceneSelect(frameNumber){ switch(frameNumber){ case 0: startscreen = new Startscreen(); stage.addChild(startscreen); break; case 1: stage.removeChild(startscreen); break; } } sceneSelect(0); function animate(){ renderer.render(stage); requestAnimationFrame(animate); } requestAnimationFrame(animate); </script>The startscreen I'm adding is an image with 320px width. As you can see I'm scaling the stage so it fits whatever screen showing it. For this the renderer works fine and the image in startscreen shows just fine. BUT! My stage.tap function doesn't register at the very right of the screen. I would say it only works on about 95% of the width. However, if i set the renderer to windowWidth + 10, the tap works all the way. But then I got this annoying line showing at the very last right pixel, so I don't wanna do that. And I shouldn't have to either, right? I mean, the renderer obviously works since the image covers the entire width? Hope you understand what I mean Quote Link to comment Share on other sites More sharing options...
Bolko Posted April 29, 2015 Share Posted April 29, 2015 Just guessing, maybe your window size is not correct, try this: // get window size: http://stackoverflow.com/questions/3437786/get-the-size-of-the-screen-current-web-page-and-browser-window var w = window, d = document, e = d.documentElement, g = d.getElementsByTagName('body')[0], stageW = w.innerWidth || e.clientWidth || g.clientWidth, stageH = w.innerHeight|| e.clientHeight|| g.clientHeight; Quote Link to comment Share on other sites More sharing options...
xerver Posted May 1, 2015 Share Posted May 1, 2015 This is a problem I feel like was mentioned elsewhere. I don't think we have a bug for it though. Please post a bug on the GitHub page so we can track it! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.