Jump to content

in mono

  • Content Count

  • Joined

  • Last visited

About in mono

  • Rank
    Advanced Member
  • Birthday 09/11/1991

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

1710 profile views
  1. Care to post the original image itself? What are the dimensions of the game? Did you try with numbers instead of percentages inside of strings when calling new Phaser.Game()?
  2. Try this: logo.smoothed = false; By the way, it doesn't matter which way you use to resize an image - scale changes the image's size and size changes its scale; they're internally tied to each other. DPI doesn't matter unless you print. If you're showing the image on a display, it's all pixels.
  3. Just check the pointer's x. function update() { if (game.input.activePointer.isDown && (game.input.activePointer.x < 200 || game.input.activePointer.x > 400)) { this.sprite.velocity.y += -50; } } Reference: https://photonstorm.github.io/phaser-ce/Phaser.Pointer.html
  4. I think a better approach would be to set the game resolution to one of the following the native resolution of each device display a resolution of your choosing, but of the same aspect ratio of the device's display I'd avoid changing the canvas via CSS - it might work for the element itself, but it may skew some positioning calculations (like it seems to be happening with that button) - to remedy that, it'd be a better idea to do it from within Phaser. If you're not going to resize and/or rotate the game, your best bet is to use game.scale.scaleMode = Phaser.ScaleManage
  5. Depends on whether you want 1:1 resolution or you'd be fine with lower than that. Generally you should aim for the design to be at least a little bit responsive. Most 2-3 year old phones and tablets are 16:9, but the current trend is 18:9 and 18.5:9; and at the opposite end of the spectrum there's Apple tablets which are 4:3.
  6. Haven't tried it, but according to the documentation, you must call the overlap method in your update.
  7. Maybe you should refer to this.game instead of just game. Phaser examples do use states, you just can't change them.
  8. I had a similar problem in a company I worked for before. We ended up doing it manually - not relying on Phaser's drag functionality but rather using tweens to update the object after some calculations are done.
  9. I guess you should simply move the hour hand by half a degree for each passed minute. 360 degrees in the whole circle, 30 degrees for each hour (360/12), 0.5 degrees for each minute (30/60) as far as the hour hand is concerned.
  10. Reuse the code and just pass what's different as a parameter. Better yet, make a class for the popups, write the open and close methods for it, then work with instances of that class.
  11. I'd add that you might take a look at Photoshop's "scrubby zoom". Basically what it does is that it allows you to zoom in and out by click and drag right/left while using the Zoom tool, but that would require an implementation of some sort of tools in your app and I don't know whether you've done that or whether you intend to do it.
  12. Mouse and modifier keys. Just look at apps meant to be used primarily with mouse and keyboard, i.e. AutoCad, Photoshop.
  13. An anchor is set in fractions, i.e. (1, 1) is the bottom right corner and (0.5, 0.5) is the middle (no matter how big the sprite actually is), whereas a pivot is in pixels (thus different for each sprite).
  14. Just swap the increment step with the next line.
  15. in mono

    get state

    It's not "too much info", it's just the whole state object. If you're looking just for an identifier, try this: game.state.getCurrentState().key It will give you the key you used to add the state to the state manager.
  • Create New...