StackContainer
StackContainer draws its children on top of each other within the same content area. This can be used eg. to draw text over an image.
Example
Section titled “Example”$container = new StackContainer;$container->addItem(new Image('example-image-large.jpeg', ImageMode::FILL));$container->addItem(new Text(draw(fill: '#fff'), 'Text over image', initialFontSize: 150, gravity: Gravity::CENTER));
// Draw container onto image$container->draw($imagick, $x, $y, $width, $height);
Template
Section titled “Template”The same layout as a template:
{ "type": "stack", "children": [ { "type": "image", "file": "example-image-large.jpeg", "mode": "fill" }, { "type": "text", "text": "Text over image", "fill": "#fff", "fontSize": 150, "gravity": "center" } ]}