Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Size of layer image
-
Is there a way to set the size of a layer's image in the scene module? I have something like this.
self.layer.image = render_text('foo')[0]
This will stretch the given text out of proportions, depending on the size of the layer. But I have fixed size layers that should have centered texts. How can I achieve this?
-
One possible solution:<br>
Create your fixed size layer and add a sublayer to it that is rightsized to your image...(imageName, imageSize) = render_text('foo') innerLayer = Layer(Rect(0, 0, imageSize.w, imageSize.h)) #innerLayer = Layer(Rect(0, 0, *imageSize) # would also work innerLayer.image = imageName self.layer.add_layer(innerLayer) innerLayer.center(self.layer.center())
-
Thanks, ccc.