Touch.Acceleration returns value 0 in WindowsPhone

0 favourites
  • 8 posts
From the Asset Store
Surena Touch
$1.25 USD
50% off
A wrap from official Touch plugin to export touch/mouse input to other plugins.
  • Ashley

    After I've finished my first bigger project (Bounce Line) I've noticed that I've could optimize the game much better, make it work on different resolutions without graphical glitches ... etc. Also I've noticed that it had some lag on mobile browsers, so I've begun to test what mobile browsers can handle.

    In the meantime time I've changed my personal phone from LG Optimus 2X (Android 4.0.4) to Nokia Lumia 925 (Windows Phone 8). While testing the C2 accelerometer functions on mobile browser I've observed that it doesn't work on Windows Phone 8 at all.

    This is the test page: http://tinyurl.com/c2acceltest

    Here is the CAPX file: BrowserAccelTest.capx

    I've invested some free time to get the following results:

    [b]Nokia Lumia 925 (WindowsPhone 8.0)
    Stock Browser (Internet Explorer Mobile 10)[/b]
    <font color="red">Battery Level: Does not work, shows 100</font>
    <font color="red">Language Does not work, doesn't show nothing</font>
    <font color="green">Platform, DevicePixelRatio, BrowserName: Works</font>
    <font color="red">AccelerationX, AccelerationY, AccelerationZ : Does not work, shows 0</font>
    <font color="red">AccelerationXWithG, AccelerationYWithG, AccelerationZWithG: Does not work, shows 0</font>
    <font color="red">Alpha, Beta, Gamma: Does not work, shows 0</font>
    
    [b]HTC Mozart T8698 (WindowsPhone 7.8)
    Stock Browser (Internet Explorer Mobile 9)[/b]
    <font color="red">Battery Level: Does not work, shows 100</font>
    <font color="red">Language Does not work, doesn't show nothing</font>
    <font color="green">Platform, DevicePixelRatio, BrowserName: Works</font>
    <font color="red">AccelerationX, AccelerationY, AccelerationZ : Does not work, shows 0</font>
    <font color="red">AccelerationXWithG, AccelerationYWithG, AccelerationZWithG: Does not work, shows 0</font>
    <font color="red">Alpha, Beta, Gamma: Does not work, shows 0</font>
    [b]iPhone 4
    Stock Browser (Safari)[/b]
    <font color="red">Battery Level: Does not work, shows 100</font>
    <font color="green">Language, Platform, DevicePixelRatio, BrowserName: Works</font>
    <font color="green">AccelerationX, AccelerationY, AccelerationZ : Works</font>
    <font color="green">AccelerationXWithG, AccelerationYWithG, AccelerationZWithG: Works</font>
    <font color="green">Alpha, Beta, Gamma: Works</font>
    [b]LG Optimus 2X
    
    Stock Browser (Android 4.0.4)[/b]
    <font color="red">Battery Level: Does not work, shows 100</font>
    <font color="green">Language, Platform, DevicePixelRatio, BrowserName: Works</font>
    <font color="red">AccelerationX, AccelerationY, AccelerationZ : Does not work, shows 0</font>
    <font color="green">AccelerationXWithG, AccelerationYWithG, AccelerationZWithG: Works</font>
    <font color="green">Alpha, Beta, Gamma: Works</font>
    
    [b]Chrome (v31.0.1650.59)[/b]
    <font color="red">Battery Level: Does not work, shows 100</font>
    <font color="green">Language, Platform, DevicePixelRatio, BrowserName: Works</font>
    <font color="green">AccelerationX, AccelerationY, AccelerationZ : Works</font>
    <font color="green">AccelerationXWithG, AccelerationYWithG, AccelerationZWithG: Works</font>
    <font color="green">Alpha, Beta, Gamma: Works</font>
    
    [b]Dolphin (v10.2.3)[/b]
    <font color="red">Battery Level: Does not work, shows 100</font>
    <font color="green">Language, Platform, DevicePixelRatio, BrowserName: Works</font>
    <font color="red">AccelerationX, AccelerationY, AccelerationZ : Does not work, shows 0</font>
    <font color="green">AccelerationXWithG, AccelerationYWithG, AccelerationZWithG: Works</font>
    <font color="green">Alpha, Beta, Gamma: Works</font>
    
    [b]Dolphin Mini (v2.3)[/b]
    <font color="red">Battery Level: Does not work, shows 100</font>
    <font color="green">Language, Platform, DevicePixelRatio, BrowserName: Works</font>
    <font color="red">AccelerationX, AccelerationY, AccelerationZ : Does not work, shows 0</font>
    <font color="green">AccelerationXWithG, AccelerationYWithG, AccelerationZWithG: Works</font>
    <font color="green">Alpha, Beta, Gamma: Works</font>
    
    [b]Opera (v18.0.1290.67495)[/b]
    <font color="red">Battery Level: Does not work, shows 100</font>
    <font color="green">Language, Platform, DevicePixelRatio, BrowserName: Works</font>
    <font color="green">AccelerationX, AccelerationY, AccelerationZ : Works</font>
    <font color="green">AccelerationXWithG, AccelerationYWithG, AccelerationZWithG: Works</font>
    <font color="green">Alpha, Beta, Gamma: Works</font>
    
    [b]Opera Beta (v19.0.1340.69518)[/b]
    <font color="red">Battery Level: Does not work, shows 100</font>
    <font color="green">Language, Platform, DevicePixelRatio, BrowserName: Works</font>
    <font color="green">AccelerationX, AccelerationY, AccelerationZ : Works</font>
    <font color="green">AccelerationXWithG, AccelerationYWithG, AccelerationZWithG: Works</font>
    <font color="green">Alpha, Beta, Gamma: Works</font>
    
    [b]Firefox (v26.0.1)[/b]
    <font color="green">Battery Level:  Works !!!</font> <img src="smileys/smiley20.gif" border="0" align="middle">
    <font color="green">Language, Platform, DevicePixelRatio, BrowserName: Works</font>
    <font color="green">AccelerationX, AccelerationY, AccelerationZ : Works</font>
    <font color="green">AccelerationXWithG, AccelerationYWithG, AccelerationZWithG: Works</font>
    <font color="green">Alpha, Beta, Gamma: Works</font>
    
    [b]UC Browser HD (v2.5.350)[/b]
    <font color="red">Battery Level:  Does not work . Shows 100</font>
    <font color="green">Language, Platform, DevicePixelRatio, BrowserName: Works</font>
    <font color="red">AccelerationX, AccelerationY, AccelerationZ : Does not work, shows 0</font>
    <font color="green">AccelerationXWithG, AccelerationYWithG, AccelerationZWithG: Works</font>
    <font color="green">Alpha, Beta, Gamma: Works</font>
    
    [b]UC Browser (v9.5.0.360)[/b]
    <font color="green">Battery Level:  Works !!!</font> <img src="smileys/smiley32.gif" border="0" align="middle">
    <font color="green">Language, Platform, DevicePixelRatio, BrowserName: Works</font>
    <font color="red">AccelerationX, AccelerationY, AccelerationZ : Does not work, shows 0</font>
    <font color="green">AccelerationXWithG, AccelerationYWithG, AccelerationZWithG: Works</font>
    <font color="green">Alpha, Beta, Gamma: Works</font>
    [b]Newman N2 / Freelander i20 (Android 4.1.1)
    
    Stock Browser (Android 4.1.1)[/b]
    <font color="red">Battery Level: Does not work, shows 100</font>
    <font color="green">Language, Platform, DevicePixelRatio, BrowserName: Works</font>
    <font color="red">AccelerationX, AccelerationY, AccelerationZ : Does not work, shows 0</font>
    <font color="green">AccelerationXWithG, AccelerationYWithG, AccelerationZWithG: Works</font>
    <font color="green">Alpha, Beta, Gamma: Works</font>
    * Strange sensor behaviour (Megaman flies out of the screen)
    
    [b]Firefox (v25.0.1)[/b]
    <font color="green">Battery Level: Works !!!</font> <img src="smileys/smiley41.gif" border="0" align="middle">
    <font color="green">Language, Platform, DevicePixelRatio, BrowserName: Works</font>
    <font color="green">AccelerationX, AccelerationY, AccelerationZ : Works</font>
    <font color="green">AccelerationXWithG, AccelerationYWithG, AccelerationZWithG: Works</font>
    <font color="green">Alpha, Beta, Gamma: Works</font>

    My conclusions:

    1.

    You could say that

    (�_�)

    ( �_�)>��-�

    (��_�)

    WindowsPhone can't handle dancing Megaman

    YEEEEAAAAAAAAHH <img src="smileys/smiley16.gif" border="0" align="middle">

    2. Browser.BatteryLevel is supported only by a few browsers (all of them on Android only). This function would be usefull for FullScreen games in order to see the battery level during gameplay until is too late (when you receive the low battery warning)

    3. Touch.Acceleration_, Touch.Acceleration_WithG, Alpha, Beta, Gamma returns the same values regardless the orientation ... So you would have to make 4 different profiles for it (Portrait, Upside Down, Landscape Left, Landscape Right)

  • It's the browser that doesn't support those features. C2 can use them if the browser supports them, but if the browser doesn't then there's not much that can be done. Hopefully the Windows Phone 8.1 update with IE11 will fix a lot of that.

  • I thought it had something to do with the manifest file <img src="smileys/smiley24.gif" border="0" align="middle" />

    Thanks for the answer

  • Is there a way to hard code in a C# method to give a value from acceleometer to the c2runtime? More explanation from me in this thread:

    http://www.scirra.com/forum/give-value-from-c-to-c2runtime_topic86681.html

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • trollface

    As far as I'm concerned, at the moment it works on Android and iOS ... And WindowsPhone 8.1 update will bring Internet Explorer Mobile 11 <img src="smileys/smiley2.gif" border="0" align="middle" />

  • trollface

    As far as I'm concerned, at the moment it works on Android and iOS ... And WindowsPhone 8.1 update will bring Internet Explorer Mobile 11 <img src="smileys/smiley2.gif" border="0" align="middle" />

    When I get my hands on the 8.1 SDK soon, I'll let you know.

  • This can be done with C#, and in truth it has been on my backlog for a long time. Windows Phone 8.1 should support it though, so I'll wait and see before adding anything.

  • I have tested the browswer test from IE (windows phone) and it works (more less) but after exporting the same project to Windows Phone and running it in the device, cant' get the alfa,beta, gamma values.

    Is this a bug ? Shouldn work ? since it works from the browser...

    Does someone knows if it's possible to get alfa, beta, gamma values from the acceloremeter when exportin to WP8 ?

    Thanks in advance

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)