scofieldly

Members
  • Content Count

    28
  • Joined

  • Last visited

About scofieldly

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. hi guys, is there any way to calculate the sprite's actual position in the dom layer, I want to make an input text to follow a phaser sprite in the canvas, thanks.
  2. hi all, I have a problem about the p2 body and sprite positon when I enable a p2 body to a sprite, I use fish.body.setRectangle(fish.width, fish.height); to set the body shape, but the position of body is far away from the sprite, anyone know what is the problem? thx
  3. scofieldly

    load assets after preload

    thx for reply, actually I don't want to load assets in the end of stateA, I want to load during the stateA, is that possible? I think there should be some way to do it. but the loading always be reset
  4. scofieldly

    load assets after preload

    Hi all, currently I got 2 state stateA assetsA stateB assetsB I want to load assetsB after stateA create completed, so when I go to stateB the preload flow can be faster even to 0. so I wrote like this in the end of stateA create part but I got some wranings this.game.load.audio('stateB1', 'assets/audio/stateB1.ogg'); this.game.load.start(); Phaser.Loader - active loading canceled / reset ----phaser-2.6.2.js:74076 and the assets are not loaded at all. so do you guys now how should I do to 【preload】assets for next state, thx
  5. scofieldly

    webgl debug by firefox

    thx for your reply, just actually I just follow rich's tutorial, anyway I will try your recommend pluin thx.
  6. scofieldly

    webgl debug by firefox

    Hi all, currently I'm read master RICH's tutorial for improve performance by batch texture. when I use the firefox dev tools canvas capture in the article https://phaser.io/tutorials/advanced-rendering-tutorial/part5 it works when I use canvas renderer, but when I change to webgl, it can not capture the analysis. FF shows error and break the app. TypeError: methodSignatureEnums is not a function-----------------call-watcher.js:168:34 I tried many version of FF and phaser. none of them can work. is there anyone tried this before and works. please give me a workable FF version, many thanks
  7. scofieldly

    how to rotate pointer's X Y

    Hi all, Currently I try to rotate the game 90 degree to meet the portrait mode for my [landscape] game, I used other's solution to rotate all display object by this.game.scale.setGameSize(, ; and Phaser.World.prototype.displayObjectUpdateTransform = function() { if(!this.game.scale.correct) { this.x = this.game.camera.y + this.game.width; this.y = -this.game.camera.x; this.rotation = Phaser.Math.degToRad(Phaser.Math.wrapAngle(90)); } else { this.x = -this.game.camera.x; this.y = -this.game.camera.y; this.rotation = 0; } PIXI.DisplayObject.prototype.updateTransform.call(this); }; now all display object are rotated, but the pointer are not rotate, so when I want to do something with activePointer like: calculation with the mouse position drag and drop logic the x, y are reversed. So I want to know is there any good solution to switch the x, y of the pointer, thx.
  8. scofieldly

    drag event when sprite scaled

    hi everyone, Here is the problem I meet, I have a sprite and I can drag it in the right way when game has normal scale but when I change scale by game.world.scale.setTo(2); things become different. the sprite moving distance become twice as my cursor moving distance, when the scale becomes 3 the distance also become triple as well. so do you gays have any good ideas for sync cursor and sprite position, many thx.
  9. scofieldly

    question about limit fps

    ok, I see, so do you know is there any method can provide me the REAL fps data (like: if the desitedFps = 30, the display fps should not higher than this number), thanks
  10. scofieldly

    onbegincontact not work

    Hi all, I want to use p2 onbegincontact to detect 2 p2 body overlap and want to do some actions, I tried to write like this body1.onBeginContact.add(func, this); but it seems when it overlap another body, the callback func did not run. is there any tips for using this event, thanks.
  11. scofieldly

    question about limit fps

    thx for reply, buy after I set the desiredFps to 30, game.time.fps still shows 60, do you meet the situation?
  12. scofieldly

    question about limit fps

    Hi all, I want to ask how to limit the fps, I tried set this.game.time.fpsMax = 30, but it does not work at all and I tried to set desiredFps to 20, and I can saw the animations become slower(it should be worked) but when I display the fps value, it still display 50-60 although I set desiredFps and it seems work so anyone know how to set the max fps value and make the display fps value also be the actual value, thanks
  13. Hi all, currently I got problem that I have a websocket thread to communicate with the server. and the game object is also start in the process, the situation is like this. when I got the response: A from the server, I will change the game to a new state by game.state.start('NEW STATE'); and then I will get the response: B, C from server, then I need to run some functions defined in the new state, like this game.state.callbackContext.function_in_new_state(); but it is not working, then I loged the state game.state.current I found that the current state is still the OLD ONE. I know the state change need some time, BUT is PHASER provide any callback method when the current state changed to another one, thx everyone.
  14. scofieldly

    resolution on devices

    hi all, currently I got a question about new Game() constructor as the define, the width and height are pixels. e.g. The width of your game in game pixels. If given as a string the value must be between 0 and 100 and will be used as the percentage width of the parent container, or the browser window if no parent is given. but when I use iphone 5s (1136 pixel width, 568 pt width) to create a 640 width game, it can not display fully, it looks that only 568 display in the screen. so I want to know how to understand this situation, thanks.
  15. scofieldly

    Mask not working in webGL render mode

    hi squilibob, I meet the same problem, and I add the endFill after the draw, but it does not work. is that line make the mask work in your case? here is my code var mask = this.game.add.graphics(0, 0); mask.beginFill(0xffffff); mask.drawRect(this.popup.position.x - 530 / 2, this.popup.position.y - 150 / 2, 530, 150); // mask.drawRect(this.popup.position.x, this.popup.position.y, 530, 150); mask.anchor.set(0.5, 0.5); mask.endFill(); return mask;