• Content Count

  • Joined

  • Last visited

About ptotheaul

  • Rank
    Advanced Member

Recent Profile Visitors

1315 profile views
  1. FlashyGoblin, was this using Cocoon's 'webview' or the 'webview+'? I'm trying to find a solution for Webview+ and nothing seems to be working.
  2. I know this topic has been addressed in older posts but none of them specify if they work in Webview+ I currently have a game using 2.10.5 that I want to run in Webview+ but I can't get the bitmap fonts to work. I tried converting the .fnt(xml) to .json using but it's still not working. Do I load the json file like:'drsob', 'assets/fonts/drsob_0.png', 'assets/fonts/drsob.json'); or change the .json extention to .xml and do:'drsob', 'assets/fonts/drsob_0.png', 'assets/fonts/drsob.xml'); ???????? Has anyone else got bitmat fonts to work in Webview+?
  3. I figured out that if I remove the .addToWorld from above the video plays however now the issue is that without the video added to the world my onComplete handler doesn't fire. Anyone have any insight into this issue? ='introvideo'); this.vidsprite =, 0, 0, 0, 1, 1);{ console.log("video over"); }, this);
  4. I just noticed that in ios12 when a video is opened in the native player from an ios phone device only the audio plays. I play the video inline on ipads: ='introvideo'); this.vidsprite =, 0, 0, 0, 1, 1); and this code would just open the native player on phones. The video plays fine on older ios versions, ipad inline on io12 and older versions, and the video plays fine in the native player if you just open it from a direct link from the browser. Any ideas why I would only be getting audio from the native player when launched from phaser but the video plays fine in the native player when opened directly?
  5. I've found this code that does what Phaser.ScaleManager.SHOW_ALL if I put it in the call back of USER_SCALE but know I need help figuring out how to limit the user scaling to the horizontal: gameResized(manager, bounds) { var scale = Math.min(window.innerWidth /, window.innerHeight /; //canvas.width = (game.width * hScale) - hTrim //canvas.height = (game.height * vScale) - vTrim manager.setUserScale(scale, scale, 0, 0); }
  6. I have a game that on mobile devices I want to scale the game to 100% of the window width and keeping the aspect ratio have the height scale up and go off screen at the bottom if the aspect ratio make the height taller then the view area. Is this possible just using the Scale Manager?
  7. I have a game that is loaded into and app that doesn't have device rotation. The aspect ration of the game is for landscape but the app is portrait so I need to rotate the whole game 90 degrees(ie so when you view it in a regular browser it's rotated. Can this be done with the forceOrientation? I can't figure it out.
  8. In case anyone else is looking for the answer to this I figured it out. From the DOM you can just call: game.state.states[game.state.current].funcFromDom();
  9. I need to call to call a function in my game state from the Dom to toggle the audio of my game. Is this possible? In index.html the game is set up like this: //////// index.html ///////////////////////////////////////////////////////////////////////// var game; (function() { game = new Phaser.Game(640, 1195, Phaser.CANVAS, 'the-game'); game.state.add("Boot",boot); game.state.add("Preload",preload); game.state.add("TheGame",theGame); game.state.start("Boot"); })(); /////////////////////////////////////////////////////////////////////////////////////////////// After preload"TheGame"); is called to load the game. The function I need to call from a button in the DOM is funcFromDom /////////////////////////////////////////////////////////////////////////////////////////////// var theGame = function(game){ }; theGame.prototype = { create: function(){ console.log("create()") }, funcFromDom: function(){ console.log("called from the dom"); }, }
  10. I have a polygon and a sprite inside of an extended group that I'm trying to check .contains on. Even though the polygon and the sprite are visually overlapping the contains is returning false. Would the .contains be relative to the stage even though //hitx , hity are points in the main game world passed into this which is an extended group that is placed at a position on the stage Building.prototype.checkbuildingoverlap = function(hitx, hity) { //this is just set up so i can see the spot i'm checking in the .contains this.tempspot.x = hitx - this.x; this.tempspot.y = hity - this.y; //this.buildinggraphics is a polygon shape if (this.buildinggraphics.contains(hitx - this.x, hity - this.y)) { console.log("CONTAINS IS HAPPENING"); } }
  11. I'm using bitmapData to capture a frame from a sprite with an atlas animation. Every thing work fine except the location of the draw is offset for the location of the original. I am scaling the original sprite but the image that is dawn is perfect except for a seemly random 155 x and 65 y offset. I can't figure out where the offset value is coming from. Can anyone see a reason this is happening? var bmd = + this.Badguy.width, this.Badguy.y + this.Badguy.height); //seems like this should should put bmd directly on top of sprite bmd.draw(this.Badguy, this.Badguy.x, this.Badguy.y); //but have to off set by 155 and 65 for it to match up. //bmd.draw(this.kaiju, this.kaiju.x + 155, this.kaiju.y + 65); bmd.update(); bmd.addToWorld(); ///////// This is how the Badguy sprite/animation is set up this.Badguy=, 180, 'badguywalk', '01.png'); this.Badguy.scale.set(2,2); this.Badguy.animations.add('walk', Phaser.Animation.generateFrameNames('', 1, 48, '.png', 2), 15, true, false);'walk');
  12. I've decided to just try and modify the pixel collision function from the Phaser source to try and occomplish what I described in the first post. Here is the general function that I"m modifying. I've changed the general sprite to the sprite I'm checking against 'Badguy'. Can someone explain what '' would be if I'm not using input and just want to check the point(x,y) passed in against the sprite 'Badguy'? checkBadGuyHitPixel: function (x, y) { // Grab a pixel from our image into the hitCanvas and then test it if (this.Badguy.texture.baseTexture.source) { var pixelPerfectAlpha = 255;, 0, 1, 1); x += this.kaiju.texture.frame.x; y += this.kaiju.texture.frame.y;, x, y, 1, 1, 0, 0, 1, 1); var rgb =, 0, 1, 1); if ([3] >= pixelPerfectAlpha) { return true; } } return false; },
  13. Is there a way to pass in an input pointer x/y values instead of having it use the mouse/tap location? What I want to do with this is at a certain time check a point against a sprite using: this.sprite.input.pointerOver() but I want to be able to define the input point that's being checked. In the end what I'm trying to do is record a tap event and then later in time(about 2 seconds) check if the tap event is over the sprite. After the initial tap the input position might move or be lifted but I still want to check against the initial tap position.
  14. I'm trying to get a pixel perfect detection of an animated sprite sheet and a single point. So in this example at any give check i could see if 'checkpoint' is over 'badguy' but the actual badguy pixels and not the rect: if (this.badguy.contains(checkpoint.x, checkpoint.y)) { //do stuff } It's like an input pixel perfect detection but with a time delay. I don't need to be constantly checking for the collisoin/contains, only at a single moment in time. Most of what comes up when looking for this is P2 physics editor collisions but that's not what I'm trying to do. It might be like the bunny example but I just want to set the input _temp point manually and relay on the mouse poisition: Is this possible?
  15. I have a long animation that will not fit on a single 2048x2048 sprite sheet. I need to keep the spritesheet/atlas that size though. What is the best way to go about defining the animation. With one Texture Packer spritesheet/atlas it looks like this: caster =, 100, 'caster', 'FIRE_00001.png'); animation = caster.animations.add('fire', Phaser.Animation.generateFrameNames('FIRE_000', 1, 23, '.png', 2), 30, true, false); Where the sprite sheet is caster.json and caster.png. With two sprite sheets the animations would be over two sprite sheets: caster-1.png caster-1.json and caster-2.png caster-2.json Since i have to preload both 'caster-1' and 'caster-2' I can't just reference a single atlas 'caster'. Do I have to create two animations and call oncomplete functions to play the next? It seems like there should be a simper way.