I already made an android/ios app, I just need to port it on Windows Phone.
At the moment, I believe that you should be able to support Windows Phone using HTML5, though we do not help automate support through the command-line tools. I personally had a lot of problems with getting approved to really target the platform.
If there’s an interest, I think that the tools could be extended to support Windows Phone using HTML5, at least, as a starting point. There are some technical things that make it difficult to target the platform on a native level – it does not support OpenGL, though I hear the ANGLE project (which implements OpenGL over DirectX) has added Windows Phone support over the time. The other blocker was “unmanaged C++ code”, which I believe was improved in the release of Windows Phone 8.
Here is my experience on Windows Phone 8.0 and 8.1 when targeting HTML5 and issues I’ve been running in to:
If I provide ANY audio, the game fails to finish loading. Otherwise, it completes an runs.
Touch input doesn’t fully work. I tried IE on Windows Phone 8.1 on a lower-end device and they did work just fine. On a separate, faster device, I tried Windows Phone 8.0. Button presses were not being detected and every time you tap the screen, the entire game content area highlighted briefly. I upgraded this same device to 8.1, and the highlight has stopped, but clicks are still not detected. Mouse X and Y do report correctly if you drag your finger around/ tap. This is weird to me as both of these devices are the same manufacturer and line of phones.
Frame rate is poor if much is going on in game. As a test (on all browser/device combos), I displayed 250 sprite sheet animations simultaneously. PC/Mac browsers can handle this at steady 60 fps. Android and iOS browsers fall down to 25-30 fps. IE on Windows Phone drops to 1-5 fps.
I would also like to see improved support for Windows phone (many clients want to include these devices nowadays). If anything I’ve mentioned is better fit for another thread, let me know. Also I can provide more details/answer questions to help.
Some browsers suffer from overdraw, it’s possible that using “-Ddom” for DOM mode would help, as it means you can use a static background image (for example) and have it remain in a DIV instead of being blitted each frame. Any BitmapData operations will still blit to a single canvas, so .draw or in the case of sprite sheets, Graphics calls also blit to a single canvas, so that might still perform as expected.
With Windows Phone 8.0, I expect that C++ support could be done, now, but each time I reached out to Microsoft employees with certain questions I had, I never got anywhere. I’m also unsure of the time commitment for getting it all working and supporting it, but if Microsoft or anyone else were interested in helping make it a reality (assuming we would use ANGLE to use OpenGL rendering over DirectX, I think) then that might be a much better target long-term than only HTML5, though we might as well improve any low-hanging fruit with the HTML5 support regardless
Thanks. I will try that updated code and see if it makes any difference. UPDATE: I updated the hx file you posted, and it didn’t make any difference to IE mobile : ( UPDATE 2: See below post re: mouse events. UPDATE 3: Fixing this to the correct event type (MouseEvent) has enabled audio playback. Two birds, one stone!
I also forgot to mention in my post that I cannot get IE to play any audio via openfl HTML5 target (if I runtime load instead of preload, which never advances). I need to do some more testing, but audio will play on PC/Mac/Android/iOS in any browser with me only providing OGG and MP3 formats. The browsers can all play M4A files on their own without plug-ins or the like, but just not through openfl/soundjs it seems. Again, I notice M4A is not considered in some source code (that I think was in soundjs), so I will try modifying that and see if I can get that format simply working. I’ll also check out soundjs threads to see if anyone has mentioned this there and report back.
And I forgot to mention, for the touch support, I am using TOUCH_BEGIN and TOUCH_END to toggle a down/up state on a button and trigger the callback. I also tried swapping in “pointerbegin” and “pointerend” event strings to no avail (supposedly IE supports these). UPDATE: I changed the Touch events to Mouse events and it is working now on my windows device. Sigh, I guess yet another conditional for IE. Wonder if we can eventually support Pointer events to mitigate these issues (http://www.w3.org/TR/2014/WD-pointerevents-20141113/).
If you can get at the event chain, that may help a bit. Here’s along the lines of what I had to do for IE mobile detection when I register my events:
var userAgent = js.Browser.navigator.userAgent;
var mobilePlatforms = ~/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i;
//check if platform is IE mobile
if( userAgent.indexOf( "IEMobile" ) > -1 )
//use mouse events...
//check if platform is mobile
else if( mobilePlatforms.match( userAgent ) )
//use touch events...
//use mouse events...
So in your case, for a quick fix, if IE mobile then detect MouseEvent and dispatch a TouchEvent in it’s place.
It may be worthwhile/better to incorporate Pointer Events, since it seems like that’s going to be the new web standard, which would mitigate these checks. For now, maybe we can safely deal with events through a PointerEvent type (listen for touch/mouse and dispatch Pointer in-place of) until PointerEvent is fully supported across browsers, then we can switch to use it normally. What do you think?
One of the updates to openfl (I suspect) seemed to resolve the mouse event problem where it wouldn’t trigger on mobile. I still think it’s a good idea to go with Pointer Events, but for now Mouse Event works again as intended on mobile touch screen browsers.
Long-term, I think that native support of Windows Phone and the Windows Store are ideal, I’ve had serious problems trying to get it to work, and the Microsoft evangelists I spoke to said they would find someone to help, but never did. I understand, though, it’s hard to find the right person sometimes
Maybe this will sound crazy , but do you try to reach Satya Nadella ? He try to make a dramatic changes in Microsoft with shift of some product to be using on other platforms such as Android and iOS ( MS Office at example) . I think if you write to him a letter with clear explanation what you try to achieve and how this will help to Windows ecosystem ( the benefit will be enormous , more games and application in windows store, more developers ) he will response. You can’t lose it if you try. This is him email which I found in internet : satyan [at] microsoft.com
Have you contacted MS Open Technologies? They contributed (and maintain) a Windows Phone back end to another popular open source game engine for all the reasons @LarryB mentions above. This is the one I’ve started working with now because I have to target WP8, but I’d really much rather write Haxe than C++
Also, are you aware of the Kha engine? It’s also Haxe, open source and can target a lot of platforms including WP8 and even PSM. Perhaps lessons could be learned from its code?
I’m also intrigued by the console targets that have been mentioned. If XB1 is on the list, as it seems to be, then doesn’t that imply a DirectX compatible back end is coming?