Jump to content

ptotheaul

Members
  • Content Count

    37
  • Joined

  • Last visited

About ptotheaul

  • Rank
    Advanced Member

Recent Profile Visitors

1683 profile views
  1. I have a few sprites acting as an avitar. When I loop through and update their position in update() there is a lag. Is there a way to update the postioion before they are rendered so they all move as one? I really don't want to have to put them in a container.
  2. Hi. If anyone is searching for an answer to this the issue was solved by adding this to the end of the spine plug in: try{module.exports=PhaserSpine}catch(err){}
  3. I am not great at web pack and can just not figure out how to get this plug in loaded. I've looked at various threads about adding other plug ins and this is how I"m trying to do it based on those: in webpack config I have: // I add the path to the phaser spine pluggin // Phaser webpack config var phaserModule = path.join(__dirname, '/node_modules/phaser-ce/') var phaser = path.join(phaserModule, 'build/custom/phaser-split.js') var pixi = path.join(phaserModule, 'build/custom/pixi.js') var p2 = path.join(phaserModule, 'build/custom/p2.js') var phaserSpine = path.join(
  4. I have a game using SHOW_ALL for the scaling. It works fine if I don’t inject the canvas into a div but if I put the canvas in: <div id='gamecontain'></div> in landscape on mobile if the address bar comes up the game does not resize and gets cut off at the bottom(it does resize if the div isn’t in the page). Any ideas how to get the canvas to resize correctly?
  5. 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.
  6. 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 https://codebeautify.org/xmltojson but it's still not working. Do I load the json file like: this.game.load.bitmapFont('drsob', 'assets/fonts/drsob_0.png', 'assets/fonts/drsob.json'); or change the .json extention to .xml and do: this.game.load.bitmapFont('drsob', 'assets/fonts/drsob_0.png', 'assets/fonts/drsob.xml')
  7. 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? this.video = this.game.add.video('introvideo'); this.vidsprite = this.video.addToWorld(0, 0, 0, 0, 1, 1); this.video.onComplete.add(function(obj){ console.log("video over"); }, this);
  8. 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: this.video = this.game.add.video('introvideo'); this.vidsprite = this.video.addToWorld(0, 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 lau
  9. 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 / this.game.width, window.innerHeight / this.game.height); //canvas.width = (game.width * hScale) - hTrim //canvas.height = (game.height * vScale) - vTrim manager.setUserScale(scale, scale, 0, 0); }
  10. 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?
  11. 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.
  12. 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();
  13. 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"
  14. 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.tempsp
  15. 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.game.make.bitmapData(this.Badguy.x + this.Badguy.width, this.Badguy.y + this.Badguy.height); //seems like this should should put bmd directly on top of sprite b
×
×
  • Create New...