Scans the group for the last member that has an Phaser.GameObjects.GameObject#active state matching the argument,
assigns x
and y
, and returns the member.
If no matching member is found and createIfNull
is true and the group isn't full then it will create a new Game Object using x
, y
, key
, frame
, and visible
.
Unless a new member is created, key
, frame
, and visible
are ignored.
name | type | arguments | Default | description |
---|---|---|---|---|
forwards | boolean |
Search front to back or back to front? |
||
nth | number |
Stop matching after nth successful matches. |
||
state | boolean | <optional> | false |
The {@link Phaser.GameObjects.GameObject#active} value to match. |
createIfNull | boolean | <optional> | false |
Create a new Game Object if no matching members are found, using the following arguments. |
x | number | <optional> |
The horizontal position of the Game Object in the world. |
|
y | number | <optional> |
The vertical position of the Game Object in the world. |
|
key | string | <optional> | defaultKey |
The texture key assigned to a new Game Object (if one is created). |
frame | string | number | <optional> | defaultFrame |
A texture frame assigned to a new Game Object (if one is created). |
visible | boolean | <optional> | true |
The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). |
The first matching group member, or a newly created member, or null.