Michel (Starnut)

Members
  • Content Count

    76
  • Joined

  • Last visited

  • Days Won

    1

Michel (Starnut) last won the day on May 10 2014

Michel (Starnut) had the most liked content!

About Michel (Starnut)

  • Rank
    Advanced Member

Contact Methods

  • Website URL
    http://gentletroll.com
  • Twitter
    starnut
  • Skype
    starnut.com

Profile Information

  • Gender
    Male
  • Location
    Würzburg, Germany
  • Interests
    Games – nothing else ;)

Recent Profile Visitors

995 profile views
  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. Michel (Starnut)

    how to update bitmapFont

    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. Michel (Starnut)

    how to update bitmapFont

    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. Michel (Starnut)

    Common Phaser + CocoonJS issues

    @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. Michel (Starnut)

    Common Phaser + CocoonJS issues

    @Binary Moon I can sure check it out. Sent you a PM with the email address.
  6. Michel (Starnut)

    Ludei Cocoonjs XML / bitmap font workaround?

    @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. Michel (Starnut)

    How to scale entire game up

    @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. Michel (Starnut)

    Common Phaser + CocoonJS issues

    @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. Michel (Starnut)

    Ludei Cocoonjs XML / bitmap font workaround?

    @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. Michel (Starnut)

    Common Phaser + CocoonJS issues

    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. Michel (Starnut)

    Common Phaser + CocoonJS issues

    @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. Michel (Starnut)

    Common Phaser + CocoonJS issues

    @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. Michel (Starnut)

    Common Phaser + CocoonJS issues

    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. Michel (Starnut)

    Where can I learn about device scaling for Phaser?

    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. Michel (Starnut)

    Common Phaser + CocoonJS issues

    @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]