r108.2 - Issue with Touch Plugin on Win8

Report Construct 2 bugs here.

Post » Mon Dec 10, 2012 1:38 am

Hi I've been developing a few games specifically for Windows 8 and noticed a small problem with the touch plugin.

Basically when you add an advertisement inside the html page generated by Construct 2 and you run it on a Windows 8 machine everything works fine. But if you touch and drag your finger over the ad and let go the touch ended for that particular touch never fires.

Now basically for the game I'm making I only need to use one touch or Touch(0). What happens is the game doesn't work properly any more because when you touch the screen again it registers as Touch(1). And if you drag your finger over the ad again it increments to Touch(2).

UPDATE: Also it is affecting the third party "Metro Plugin" whenever you request the user to purchase the app, the touch never ends.

NOTE: You have to export the project as a Windows 8 project then open it in Visual Studio first. Then place the ad inside the generated html page from Construct 2.

I did do a little test to see where exactly the touches are when a user touches the screen by drawing a sprite to that position. After you perform what I mentioned above the sprite appears where the last known touch occurred. If you hold it long enough it then shifts to where the new touch is.

I originally though it was a Win8 bug, but the fact that Construct2 uses the last touch position randomly and then updates to the new touch position like 2 seconds later seems like the program.
B
6
S
1
G
1
Posts: 13
Reputation: 827

Post » Tue Dec 11, 2012 5:12 pm

I've heard about this before, and I'm pretty sure it's a Windows 8 bug. We definitely listen for all the touch end or touch cancel events that Windows 8 sends, and in this case it sounds like it ought to fire a touch cancel bug, but it doesn't. I'll get in touch with Microsoft and see if they can comment. In the mean time can you share a complete Visual Studio solution that demonstrates the problem so we can reproduce it?
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Tue Dec 11, 2012 5:38 pm

@loyalpenguin - actually I'm not sure it's a Windows 8 bug... are you using a fullscreen mode? If not, that might be related...
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Tue Dec 11, 2012 9:50 pm

Yes, I'm using Letterbox Scale.
B
6
S
1
G
1
Posts: 13
Reputation: 827

Post » Tue Dec 11, 2012 10:27 pm

@loyalpenguin - have you tried r112? I've made a change that might help.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Wed Dec 12, 2012 12:57 am

@Ashley Sure thing. I'll let you know what happens.
B
6
S
1
G
1
Posts: 13
Reputation: 827

Post » Wed Dec 12, 2012 3:11 am

@Ashley I did try it, unfortunately it didn't fix the problem. I'm not sure how I can send you a Visual Studio project, but it is pretty simple to reproduce the problem.

Pretty much just add a text object to the screen and set its text to the number of touches. Then just export as a Windows 8 project. After you export it add a reference to the Microsoft Advertising SDK inside the head section like so:

<script src="/MSAdvertisingJS/ads/ad.js"></script>

After you do that add the following html next to the C2 canvas like this:

<!-- The canvas the project will render to. If you change its ID, don't forget to change the
          ID the runtime looks for in the jQuery events above (ready() and cr_sizeCanvas()). -->
          <canvas id="c2canvas" width="1366" height="768" oncontextmenu="return false;" onselectstart="return false;">
              The browser appears to have HTML5 disabled. Try checking the compatibility settings.
          </canvas>
     
        <div style="position:absolute; width:100%; bottom:0px;">
            <div id="myAd" style="margin-left:auto; margin-right:auto; width: 728px; height: 90px; z-index: 1;"
              data-win-control="MicrosoftNSJS.Advertising.AdControl"
              data-win-options="{applicationId: 'REPLACE-WITH-APPLICATION-ID', adUnitId: 'AD-UNIT-ID'}">
            </div>
        </div>

Take note I got the instructions from here:
http://msdn.microsoft.com/en-us/library/hh506343(v=msads.10).aspx

Pretty much just run the project after that, touch inside the canvas and drag until your on top of the ad and release. Then touch the screen again and it should increment the amount of touches. You might be right about it being a Win8 thing. I just wish they had a work around for it.

Hope this helps. loyalpenguin2012-12-12 03:15:22
B
6
S
1
G
1
Posts: 13
Reputation: 827

Post » Fri Dec 14, 2012 7:59 pm

@Ashley were you able to try the code yet? I did post something in the Microsoft forums to see if they could provide some insight.
B
6
S
1
G
1
Posts: 13
Reputation: 827


Return to Bugs

Who is online

Users browsing this forum: No registered users and 0 guests