Jump to content

Search the Community

Showing results for tags 'parents'.

  • 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. Hey guys, I did a search of the forums as well as the Phaser/Pixi docs and came up short (let me know if it's answered anywhere else). I'm trying to create a mechanic whereby the player is able to pick up and drop sprites. I've been able to achieve pickups by using the group.add() function where the group parent is the player sprite, but when using .remove() to drop the sprite, the sprite just completely disappears. Its position, alpha, scale etc all look sensible and haven't been modified. What I have seen however is that the sprite parent name changes to being undefined, which seems unhealthy as when it spawns in the world its parent appears to be "__world". I also tried directly calling addChild() inherited from Pixi which is used in the Phaser groups, and the result was the same. It's easy to reproduce, my code is below. This is in .create() this.testGroup = game.add.group(PLAYER) this.testLight = game.add.sprite(300, 300, "buttonGradient");This is in .update() if (PLAYER_OBJECT.inputIsActive("y")) { this.testGroup.add(this.testLight); } if (PLAYER_OBJECT.inputIsActive("u")) { this.testGroup.remove(this.testLight); }Does anyone know if my setup is bad, or if there are other ways to achieve my desired effect? I had a look at the group remove example on the official examples page and the same thing happens there - I don't know if it's a bug or an intentional result of the system. Thanks in advance!
×
×
  • Create New...