Michał Lipa Posted October 29, 2017 Share Posted October 29, 2017 How I can add custom parameter of element of group. I need set that parameter during element creation. That will be string. My group: items = game.add.group(); items.enableBody = true; items.physicsBodyType = Phaser.Physics.ARCADE; creation of a new element: //Can I add custom parameter over here? I mean during creation items.create(new.x, new.y, 'texture'); Is there any option to set custom parameter during element creation? Right now I have elements with x, y, texture but I want one more paremater with my custom string. Link to comment Share on other sites More sharing options...
samme Posted October 29, 2017 Share Posted October 29, 2017 You can't do it via Group#create, but that method returns the new sprite, so you can just modify it there. Link to comment Share on other sites More sharing options...
Recommended Posts