Marine

Get container by name

Recommended Posts

I gave the names to my Containers and want to get them using  that names(with setName ). For example, I have Container with name 'Container1', 'Container2' ... I want to find the container with 'Container2' name. How can I do that?

Share this post


Link to post
Share on other sites
9 hours ago, iKest said:

Phaser does track Game Objects by name with getByName(...) or getAll('name', ...) methods

I'm getting null when typing this.container.getByName('3') .
inside my containers there is an image and this ->  this.container.getByName()  return my Image which does not have name. I think thats because i gave null. But i want to return not the Image but Container  

 

Share this post


Link to post
Share on other sites
8 hours ago, samme said:

Well, it doesn't track them, but it can search them.


Phaser.Actions.GetFirst(containers, { name: 'Container1' });

 

Im getting error this way too. 

My code is -> 

Phaser.Actions.GetFirst(this.squareContainer, { name: '1' })

Screen Shot 2018-09-21 at 10.04.08 AM.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.