Michel (Starnut)

  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by Michel (Starnut)

  1. Hey guys, it's been a while and I've grown a bit rusty. I've build this small game in landscape mode, set it to SHOW_ALL scaling and now have two issues that seem related to me: 1. on Safari mobile on an iPhone 6S+ (the large one), tabs will not be hidden but, instead, overlap the game from the top. 2. on Android the software navigation bar overlaps the game from the bottom and makes it literally unplayable since the buttons are hidden under it. (images attached to this post) Is that a regular behavior or can I do something about it? Here is my entire mobile scaling code and the entire HTML header I took from an older Phaser game template. What am I missing? Thanks, Michel this.stage.disableVisibilityChange = true; this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; this.scale.setMinMax(480, 260, 945, 530); this.scale.pageAlignHorizontally = true; this.scale.pageAlignVertically = true; this.scale.forceOrientation(true, false); this.scale.setResizeCallback(this.gameResized, this); this.scale.enterIncorrectOrientation.add(this.enterIncorrectOrientation, this); this.scale.leaveIncorrectOrientation.add(this.leaveIncorrectOrientation, this); <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="chrome=1, IE=9"> <meta name="format-detection" content="telephone=no"> <meta name="HandheldFriendly" content="true" /> <meta name="robots" content="noindex,nofollow" /> <meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-status-bar-style" content="black" /> <meta name="apple-mobile-web-app-title" content="Phaser App"> <meta name="viewport" content="initial-scale=1 maximum-scale=1 user-scalable=0" />
  2. Ok, so I dug a bit deeper in the Pixi code and found a quick workaround where you don't set the font but the fontName attribute: myBitmapText.fontName = "myNewFontKey"; // where "myNewFontKey" refers to a font previously loaded into the cacheYou won't find fontName in either documentation since it's only being used as a private field. Essentially, Phaser would also need to set the fontName attribute in the font attributes setter and the problem should be fixed. Update: Filed this issue on GitHub: https://github.com/photonstorm/phaser/issues/1602
  3. Having the exact same problem here. Also took a quick look at the BitmapText source code and saw nothing suspicious. When I log the font field it does return the correct name, though. Maybe a Pixi issue since that's where the rendering happens?
  4. @Jirka1111 Maybe check you max scale settings in the boot code of the game? Maybe you currently don't allow the game to scale up all that much?
  5. @Binary Moon I can sure check it out. Sent you a PM with the email address.
  6. @zablockijj Hard to tell what's wrong if the debug console remains silent. If it failed to parse the JSON files you'd for sure get an error. Maybe the problem lies elsewhere? I have to admin that I haven't tried Phaser 2.0.7, yet, but either way I'd stick with CocoonJS 2.0.2 (not 1.4.7). And I would make sure to avoid building potential traps with complicated checks that are supposed to return true anyways. Keep it simple and remove all potential trouble makers until it works ... //if (navigator.isCocoonJS) { cocoonjsphaser.utils.fixDOMParser();//}var fileFormat = '.json';//(navigator.isCocoonJS) ? '.json' : '.xml';... and then slowly start commenting in the code again until it breaks. @patmood thanks for the feedback. Glad I could help
  7. @cuchi12 If you posted your init and scaling code, the Phaser version you're working with and a screenshot of your game showing the problem you're trying to solve answering your question would be a lot easier
  8. @Binary Moon: Yes, that's what I'd do. Request a compiled version from the ludei site and you'll get an XCode project you can build and test directly on your device. That way you'll make sure your app is as close as possible to the final product.
  9. @Toknos I pasted the DOMish parser code right before creating the game instance within the index. I didn't put it into a file of it's own. It looks like this: <script type="text/javascript">(function (cocoonjsphaser) { cocoonjsphaser.utils = { fixDOMParser: function () { window.DOMParser = DOMishParser; } }; //... rest of the implementation}(window.cocoonjsphaser = window.cocoonjsphaser || {}));(function () { // I use this HTML file for CocoonJS only, so no extra check necessary. cocoonjsphaser.utils.fixDOMParser(); //... check for width and height. var game = new Phaser.Game(width, height, Phaser.CANVAS, ''); //... declare states and start Boot state.})();</script>Both scripts (haden's and my adaption) only work with XMLs in BMFont format. So either use the BMFont tool (Windows) directly to create them or use a tool that produces equivalent (e.g. bmGlyph on Mac) output. Then run the script to convert the XMLs. I'm not sure but I think I remember Littera output to not be compatible. Also: make sure, your cocoonJS checks works and returns "true" under CocoonJS. If you don't use Phaser.States in your project, but instead have all the code in one file, you may have to omit 'this.' in 'this.game.device.cocoonJS' in order to make it work - but then again your load call shouldn't work either, so maybe you are using states - but I thought I'd just mention it. Let us know if any of this helped.
  10. Great work @Videlais, thank you so much for the effort! It's such great news that everything is finally coming along. And I'm really looking forward to your Gamepad adaption. Can't wait to get testing on my OUYA as well And also great to hear that Ludei themselves have started contributing to improve integration. That's the kind of news I love waking up to Now, I'm currently working on the best setup to make the game adapt device dimensions (for mobile, on desktop, under cocoon) which works best with the snippet I posted earlier. But that'll need some compiling and testing. @Videlais, have you tried playback of various audio formats again? Wondering if anything changed about my from late May that WAV works (and loops) best across devices?
  11. @j0hnskot since Rich has fixed (and integrated fixes for) quite a lot of issues for 2.0.6 and 2.0.7, there indeed is a good chance TileSprites were one of the issues solved. Had no time to see for myself though.
  12. @korgoth Hi, so I tried it myself and EXACT_FIT works for me and fixes the issue. It doesn't really seem to distort stuff, though, in contrast to my expectations. Maybe it just sets things right, since my app looks fine in the launcher, but the final compiled version has this glitch. Anyways, just to make sure you're problem doesn't lie somewhere else, I init my game like this (Phaser 2.0.4, CocoonJS 2.0.2) and take care of the scaling within the game myself (work a bit with room): var w = window.innerWidth * window.devicePixelRatio, h = window.innerHeight * window.devicePixelRatio, width = (h > w) ? h : w, height = (h > w) ? w : h;// Hack to avoid iPad Retina and large Android devices. Tell it to scale up.if (window.innerWidth >= 1024 && window.devicePixelRatio >= 2){ width = Math.round(width / 2); height = Math.round(height / 2);}// reduce screen size by one 3rd on devices like Nexus 5if (window.devicePixelRatio === 3){ width = Math.round(width / 3) * 2; height = Math.round(height / 3) * 2;}var game = new Phaser.Game(width, height, Phaser.CANVAS, '');And since you've asked, here is a link to the game on the web (which currently does not scale above 1024x768 on the web): http://sandbox.starnut.com/sensigame/ Hope this helps... Cheers, Michel
  13. Hi @Videlais, and @rich, Next week, I'll be working on an update for my Phaser 2.0.4 / CocoonJS 2.0.1 game where I'll try and build back the workarounds I created for cocoonjs in order to reduce code complexity and improve maintainability. I'll be glad to contribute whatever I'll find. And I gotta say once more, that I'm also super happy with how things came along since spring!
  14. If you're working with the full screen mobile template that comes with Phaser (resources/Project Templates/Full Screen Mobile/), everything scaling is taken care of within the Boot state (Boot.js). Additionally you may find some interesting approaches in this thread: http://www.html5gamedevs.com/topic/1380-how-to-scale-entire-game-up/
  15. @korgoth: sure does. That's why I said I realize you want to stick with SHOW_ALL but it looks like the distortion wouldn't be huge, so you might wanna give it a shot. I'm gonna since it might be the quickest fix with a minor drawback. But I'll spend some minutes on the issue within my project on Thursday. Might find something else. Are you instantiating the game with a fixed dimensions and then scaling up as your code suggests? Cause I'm essentially using the approach where I create the game with the device dimensions - and I still have the problem which is ultra weird. Then again I may have set maximum scaling sizes to values that are not fully compatible with the Nexus 5 dimensions, thus, causing the error. [Edit]Sorry, no link. Game is not public, yet. And AFAIK it only occurs when wrapped into CocoonJS.[/Edit]
  16. @korgoth: I have the exact same bug on my list as it appears with my game running on the Nexus 5. As mentioned earlier in this thread, setting scaleMode to EXACT_FIT should fix this. But I realize that you may want to stick with SHOW_ALL. Don't know if that'll work though. @rajeev90km: I used localStorage directly with Phaser 2.0.4. Not window.localStorage but just localStorage and it worked with Canvas+ and in all browsers I tested. Also on desktop. But using the Device property is probably the safest way to do it since the framework could potentially do additional checks on it in special cases. I just didn't realize it existed so thx
  17. Just read through all of the recent posts (been away for a while) and feel very happy to finally hear a Ludei voice on this topic and see that some things have already improved. Thanks guys! Really looking forward to future Phaser/Pixi integration into CocoonJS!
  18. That's actually the point: Nobody was trying to run their game under WebGL. People were running their games in Phaser.CANVAS mode, but under CocoonJS, it seems, WebGL wouldn't shut off entirely and, thus, messed up rendering.
  19. And on a side note: if anyone is looking for a way to store information like player progress with CocoonJS, localStorage worked like a charm. No complications there. No extensions needed.
  20. @Videlais: Thanks for contacting Ludei directly. That's great news since it sounds like we can actually fix it. What I don't get is why they didn't answer publicly to my request, which, by now, has six votes and two more comments with people sharing the issue. Especially, since they obviously know the answer to that one, I don't know what actually kept them from letting us know. Quite disappointing. If I'd had that information a week ago, I may not have lost a day fixing things manually by replacing TileSprites and stuff. Oh well... for the next project. In other news: I was struggeling with sound under CocoonJS again on the week end. It turned out that everything behaves quite differently if you don't trigger the sounds directly on start up. Essentially, nothing worked reliably at all. Sometimes the sounds would play, sometimes not. There didn't seem to be a pattern except one: If I tapped before or at the beginning of the load process we had more, if not all sounds play. So, eventually, I tried this and it did the trick: Before preloading any audio (so actually in my Boot state), I sneak touch input from the player by letting him choose whether she wants to start a new game or continue the old one. After that selection I load everything I didn't need at that point, including all audio (that first click has to go silent) displaying the preloader and sound always works reliably afterwards. That actually solved all of our problems. It seems that sound just won't work reliably if you don't get user input before preloading the audio files (and Phaser probably does something in the background that should be done after the touch occured). Also, I've stuck with WAV for now, since it works on both Android and iOS but played back cleanest on iOS, especially when looped. Looping in general, sadly, still is an issue, though. I've experienced quite some lags when looping on Android (Nexus 7 1Gen and Nexus 5). Sound playback works actually way better within Chrome on both devices. Well, but it all looks way better than only a week ago now. And though I've had some very frustrating moments with CocoonJS up until now I'm quite happy with what I submitted to the App Store yesterday Let's hope all of this improves some more turns into actual fun into the very near future Note: I'll update my above posts concerning audio, so they're not misleading. EDIT: Just a thought: it may be enough to add the audios to the game (via game.add.sound) after the first click occured. I'm not sure I've checked that. Then again I've checked so much this week end I'd be surprised if I hadn't tried that option. Well, if somebody cares to give it a shot, I'd be curious about the results.
  21. Apparently input listeners on the game instance itself still work while the game is paused. This code works fine for me: showMenu: function() { // show the menu this.menu.show(); // listen to any input on the game this.game.input.onDown.add(this.hideMenu, this); // pause the game this.game.paused = true;},hideMenu: function() { // get the menu's rectangle var rect = new Phaser.Rectangle().copyFrom(this.menu); // check if the user tapped inside the rectangle if (rect.contains(this.game.input.x, this.game.input.y)) { // hide the menu this.menu.hide(); // remove the listener this.game.input.onDown.remove(this.hideMenu, this); // unpause the game this.game.paused = false; }},
  22. Hey Videlais, No worries. I've had my share of CocoonJS trouble, too, now and I can totally understand you had to take a break from it Thanks for the additional info and that great link with the HTML5 feature set. Never seen that one before. Might turn out quite helpful. For Audio I'm going to go with OGG (EDIT: WAV) since it seems to be the only format working on both platforms. Sadly, the "WebGL Enabled" bug is the most crucial part and absolutely vital for my project and I'm on a very tight schedule here. I bet everything on CocoonJS in January hoping these things would be fixed, by now, and am a little disappointed about the progress that the Phaser-CocoonJS integration has made since then, especially since these issues have been known for so long. Ludei lists Phaser and Pixi on their front page and says integration works seamlessly and it just doesn't. Also, I don't get why quite some of the launcher settings aren't available in the cloud compiling system. Not even to premium users. What use is it having them in the Launcher, if they don't work in the final product? Well, at least we found some hacks to work around e.g. the image display bug. But, sadly, it does not work for TileSprites. I'll have to replace those manually with regular sprites, I guess, since I'm running out of time. I need to submit my app to stores on Friday taking into account Apple's review time. I don't expect Ludei to provide a solution just in time. So far, there has been no feedback, but then again, I posted the request on the weekend and it's only Monday morning 4am in SF right now Thanks for keeping an eye on this, though. It's good to know that you actually have these contacts and there are options to directly commute with them.
  23. @Nambiar: My input events work absolutely fine with Canvas+. If you posted your concrete setup (Cocoon version, Phaser version, device, OS) and a bit of sample code, we could actually help you find the problem.
  24. Good news, everyone: I got audio to work! (Within the CocoonJS Launcher. Will check compiled app and reconfirm. EDIT: Works!). Thanks to an idea from @Haden (thanks again for that), I found out that M4A isn't even supported under CocoonJS - not even on iOS. So here goes: Setup (as mentioned above): - Phaser 2.0.4 (Canvas+) - CocoonJS 2.0.0 - iPhone 5 iOS 7.1.1 1. I tested M4A, WAV, MP3 and OGG. M4A wasn't even loaded and only MP3 and OGG did actually play back. EDIT: We have MP3, OGG, WAV on iOS, OGG and WAV on Android. 2. Just like in some other mobile browsers, playback only worked after one initial touch, after preload was complete. EDIT: It turned out to be absolutely essential this touch happens BEFORE any audios are being loaded into the game. See this post for details. 3. A previous muted playback as suggested by @Haden in the above post, was not necessary. EDIT: Still isn't if you get touch input before loading. 4. Simultaneous playback of multiple audios works (I tested with two). 5. I experienced some slight lags between playbacks when looping. The lags appeared more frequent the longer the audio was. These may be different for CocoonJS 1.4.7 and other versions of Phaser. What. A. Day! I guess, I can go home and sleep soundly now. @videlias: You may have to update some stuff on the front page.
  25. In the meantime I was able to compile my project to check if the WebGL issues reappear in the compiled version and, as expected, they do. I have now filed a question under "Problems & Troubleshooting" in hopes that Ludei will point me to a solution for this problem. If you guys care, you can upvote the question here: http://support.ludei.com/hc/communities/public/questions/201838788-Turn-WebGL-Enabled-off-in-final-app- Maybe that'll help get some speedy replies.