Is it possible to have a Tile with transparent background?
Yes. Any color can be transparent using blue.toAlpha(.2) for instance or "rgba(0,0,0,.2)" but may as well use .toAlpha() it is easier.
I tried that and it still provide a white background.
const tile = new Tile({
obj: new Rectangle(30,30,[convertColor(green, "rgba", .01), convertColor(blue, "rgba", .01), convertColor(pink, "rgba", .01)]),
cols:10,
rows:10,
spacingH: 0,
spacingV: 0,
backgroundColor: convertColor(white, "rgba", 0.1)
})
.reg(CENTER)

F.color = purple
const tile = new Tile({
obj: new Rectangle(30,30,[red, blue, green]).rot(45),
cols:10,
rows:10,
spacingH: 20,
spacingV: 20,
// backgroundColor: convertColor(white, "rgba", 0.2),
backgroundColor: white.toAlpha(.2)
})
.reg(CENTER)
.center()
It works for us - the backgroundColor is under the object. If you want a general backgroundColor then use backdropColor. And note - the color.toAlpha() is shorter to type and easier to understand.
Yes, it worked indeed. That was my mistake. I place a rectangle below the Tile to imitate its border and omit to turn it off.
Sorry for that. Thank you so much for always being with us.
1 Like
Our pleasure - nice to have you back on the forum.