Jump to content

Search the Community

Showing results for tags 'extended'.

  • 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 1 result

  1. Hi, guys. First of all, I've found Phaser amazing. And though my knowledge of Javascript is pretty basic, almost everything has been done without too many problems. I got a problem with sprite cropping. So I extended Sprite... var cropRect;var some_obj;Medidor = function(game, x, y, someObject) { Phaser.Sprite.call(this, game, x, y, 'medidor'); [...] this.cropEnabled = true; cropRect = new Phaser.Rectangle(0, 0, this.width/2, this.height); this.crop(cropRect); [...] game.add.existing(this);};Medidor.prototype = Object.create(Phaser.Sprite.prototype); Medidor.prototype.constructor = Medidor;Medidor.prototype.update = function() { [...] this.updateCrop();};But when I run the game, an error appears: TypeError: this.crop is not a functionI have even followed the example here: http://examples.phaser.io/_site/view_full.html?d=sprites&f=dynamic+crop.js&t=dynamic%20crop I don't know what I am doing wrong :/ Any ideas? Thanks in advance,
×
×
  • Create New...