Jump to content

Search the Community

Showing results for tags 'pointers'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 4 results

  1. I'm using PhaserCE 2.10.0 and I've setup my game in (256) x (256*aspectRatio) in portrait mode using the SHOW_ALL scale method to size up to the screen. Everything's been going pretty well, but now I've run into a weird issue. I'm just not sure if it's a bug I should report or if I should just be doing something different. On android(in chrome and the cocoon dev app) pointer coordinates(read via input.pointer#.x|y) max out at 104. On desktop, it works just fine, with x coordinates maxing at 255 and y maxing dependent on the screen aspect ratio. Here's a debug shot of my input dev view where I touched 2 fingers down near the center of the screen and moved them to opposite corners of the view. I've tried a few different versions of Phaser 2.10.1, 2.7.10, and 2.4.9 and found that the issue goes away with 2.4.9. Obviously, I could just use an old version for now but... I don't wanna. Anyone with more Phaser experience know what might have changed to cause this? If it helps, here's my init call: App.game = new Phaser.Game({ width: scale.width, height: scale.height, renderer: Phaser.AUTO, antialias: false, resolution: 1 }) Boot state setup: Boot.prototype.create = function _Boot_create() { this.game.time.advancedTiming = App.debug this.game.renderer.renderSession.roundPixels = true this.game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL this.game.scale.pageAlignHorizontally = true this.game.scale.pageAlignVertically = true this.game.scale.refresh() this.game.state.start("load") } Play state create: Play.prototype.create = function _Play_create() { var scale = Util.scale() this.world.resize(scale.width, 5*scale.height) this.physics.arcade.gravity.y = 750 this.stage.backgroundColor = "#aaddff" this.player = new Player(this) new Floor(this, this.game.world.height) new Platform(this, 64, this.game.world.height - 64, 64, 1) this.camera.follow(this.player.sprite) this.controls = new Input(this) } Input setup for Play state: var Input = function _Input ( scene ) { this.scene = scene this.cursors = this.scene.input.keyboard.createCursorKeys() this.scene.input.gamepad.start() this.pad1 = this.scene.input.gamepad.pad1 this.p1 = this.scene.input.pointer1 this.p2 = this.scene.input.pointer2 this.butt = 0 this.scene.input.gamepad.onDownCallback = function (e) { this.butt = e } }
  2. In my game if you touch the screen and then move the pointer, the fps drops from 60fps to 35-40fps. ( tested in galaxy s3 mini ) And has nothing to do with my code, if I try this example: http://phaser.io/examples/v2/input/multi-touch The highest fps I get it's 50 without doing anything ( CANVAS mode ) Moving 1 pointer : 30-35fps Moving 2 pointers: 25-30fps. Pointers are very usefull, but they seem to be slooow. Is there anyway to optimize this? or at least replace the pointers with something else? I have a virtual gamepad to move a spaceship and a button to shoot. Thanks
  3. I'm trying to build a button for mobile devices with the following characteristics: The button goes down when there is a pointer in a down state over itThe button goes up when there are no pointers in a down state over itvar myButton = game.add.button(x,y,'myButton');myButton.inputEnabled = true;myButton.onInputDown.add(goDown,myButton);myButton.onInputOver.add(goDown,myButton);myButton.onInputUp.add(goUp,myButton);myButton.onInputOut.add(goUp,myButton);function goUp(){ this.isDown = false;}function goDown(){ this.isDown = true;}Everything works fine except for when the button goes down because of `onInputOver` but doesn't go up when the pointer goes up (in a mobile device, when a pointer goes over, it is necessarily in a down state). Apparently Phaser looks for `onUp` events only from pointers who were pressed directly on the button. How can I get the result I'm looking for?
  4. Hi guys ! We're currently try to make a game with Phaser and it's just awesome ! But I have an issue right there with the Touch pointers (and Buttons). My problem is when you put your finger on the screen, the pointer is declared active. But if you slide outside the screen(keep the finger on the screen but go outside the game screen), your pointer is still active. And you cannot unable it (if you touch the screen again, it's the second pointer which is detected). And this is the issue, because i wanted to create buttons on the bottom of the screen but if you touch the screen too close from the edges, the character would not stop moving (if the button is a direction button). I tried first with buttons and not pointers, and it's the same issue. Altough, if you click on the button again, it resets the button and the character stop moving. But we cannot let the character moving across the map if nothing is touched on the screen. I tried something like this to solve this issue, but if you move too fast it doesn't work. (Game screen is 800*600) if(PhaserGame.game.input.pointer1.active && PhaserGame.game.input.pointer1.y <= 595){ //alert(PhaserGame.game.input.pointer1.y); if(PhaserGame.game.input.pointer1.x > 25 && PhaserGame.game.input.pointer1.x < 125){ Player.moveLeft = true; Player.moveRight = false; } else if(PhaserGame.game.input.pointer1.x >= 125 && PhaserGame.game.input.pointer1.x < 225){ Player.moveLeft = false; Player.moveRight = true; } else { Player.moveLeft = false; Player.moveRight = false; PhaserGame.game.input.pointer1.reset(); } } else { Player.moveLeft = false; Player.moveRight = false; PhaserGame.game.input.pointer1.reset(); }Thank you in advance for your answer !
×
×
  • Create New...