How to add Phaser.Geom.Rectangle to a group?

Hi,

I would like to check if a solo rectangle and the others rectangles who are on a group are overlapping. So i made this :

var solo_rect = new Phaser.Geom.Rectangle(0, 0, 100, 100)
var group =  this.add.group()
var rects=[]
	for (var i = 0; i < 20; i++) {
rects[i] = new Phaser.Geom.Rectangle(0, 0, i*100, i*100)
group.add(rects[i])
}
var overlap = Phaser.Geom.Rectangle.Overlaps(solo_rect, group)
console.log(overlap)

But that don’t works i have this error :
Uncaught TypeError: t.on is not a function
at initialize.add (phaser.min.js:1)
at initialize.create (main.js:461)
at initialize.create (phaser.min.js:1)
at initialize.loadComplete (phaser.min.js:1)
at initialize.h.emit (phaser.min.js:1)
at initialize.loadComplete (phaser.min.js:1)
at initialize.fileProcessComplete (phaser.min.js:1)
at t.onProcessComplete (phaser.min.js:1)
at Image.data.onload (phaser.min.js:1)

What could i do ?

Thanks

try this maybe…
let solo_rect_bounds = this.solo_rect.getBounds();
let group_bounds = rects[i].getBounds();
Phaser.Geom.Intersects.RectangleToRectangle(solo_rect_bounds, group_bounds)

Thanks Villan for your response, but that don’t work too.

try to using matter+physics (for the overlap) but i have difficulties…

this line make problem :
this.matter.world.setBounds(0, 0, data.world, data.world, 32, true, true, false, true).disableGravity()

and without arcade everything works …?

however my config is like this :

 var config = {
	type: Phaser.CANVAS,
	width: 1480,
	height: 2270,
	backgroundColor: '#02003e',
	parent: 'phaser-example',
	//pixelArt:true,
	physics: {
		matter: {
			debug: false,
			gravity: {
				//y: 0.5 
			}
		},
		arcade: {
			debug: false,
			gravity: { 
				//y: 200 
			}
		},
	},
	callbacks: {
		postBoot: function (game) {
			game.canvas.style.width = '100%';
			game.canvas.style.height = '100%';
		}
	},
	scene: {
		preload: preload,
		create: create,
		update: update,
	}
}