Jump to content

Search the Community

Showing results for tags 'add to group'.

  • 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 All, I am using Phaser 2.5.0 I am trying to add a graphics (polygon) to a group. Please see the below code for your reference. I am getting below two javascript errors. Uncaught TypeError: child.setStageReference is not a function phaser.js:14661 Uncaught TypeError: this.children.preUpdate is not a function phaser.js:33643 The error is comming from the last line this.wrongLocation.add(poly); Can some one please let me know what could be the reason for the error. Please note that i can add a sprite to a group using similar code without any problem. Thanks for your help this.wrongLocation = this.add.group(); this.wrongLocation.enableBody = true; x = 360; y = 0; var poly = new Phaser.Polygon([ new Phaser.Point(x+64, y), new Phaser.Point(x+131, y+33), new Phaser.Point(x+66, y+64), new Phaser.Point(x, y+32) ]); graphics = this.gathis.add.graphics(0, 0); graphics.beginFill(0xFF33ff); graphics.drawPolygon(poly.points); graphics.endFill(); this.wrongLocation.add(poly); Also I try to add the graphics to the group as below code me.wrongLocation.add(graphics); I can't see the error but the overlap between a sprite and this graphic is not working with the below code me.game.physics.arcade.overlap(me.taxiNE, me.wrongLocation, me.hitTheRoad); Any help will highly appreciated
×
×
  • Create New...