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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.