Если изменение порядка на самом деле не вариант, возможный обходной путь может заключаться в игре с цветами и режиме наложения, чтобы сделать видимыми ниже элементы.
Например, если у вас черный фон, то белый текст, а затеморанжевый круг поверх него, если оранжевый круг имеет режим смешивания screen
, белый текст все равно будет виден через него.
Вот эскиз , демонстрирующий решение.
// draw a black background so we can see white text
new Path.Rectangle({
from: [0, 0],
to: [200, 200],
fillColor: 'black'
});
// draw a white text
new PointText({
content: 'Your label here',
point: [100,80],
fontSize:20,
justification: 'center',
fillColor: 'white'
});
// draw a circle with screen blend mode
new Path.Circle({
center: [50,100],
radius: 50,
fillColor: 'orange',
blendMode: 'screen'
});
// draw a circle with normal blend mode
new Path.Circle({
center: [150,100],
radius: 50,
fillColor: 'orange',
blendMode: 'normal'
});
// draw instructions
new PointText({
content: 'Left circle has a screen blend mode so text is visible even if it is below it',
point: view.center + [0, -50],
justification: 'center'
});
![enter image description here](https://i.stack.imgur.com/ASP4d.png)