Alpha on rectangle

Hi there :slight_smile:

I would like to do a rectangle transparant like that :

var r1 = this.add.rectangle(400, 200, 480, 80, 0XB45F06 );r1.alpha(0.5);

but it say

Why i can’t do that please ?

thx, sorry for the newbie i am, i’m doing phaser since 2 weeks only, i find it wonderful, but you know, i still learn :slight_smile:

rect.setFillStyle(color, alpha);
rect.setStrokeStyle(lineWidth, color, alpha);
1 Like

ok i didn’t expect that, thx :slight_smile:

r1.setAlpha(0.5);

or

r1.alpha = 0.5;
2 Likes