Sorry, we don't support your browser.  Install a modern browser

Cropping images#1969

Hi,
I was wondering if it would be possible to draw a cropped image in UI? For instance, I want to draw the image of a card to everyone in the UI, but the source image of the card contains multiple images (example : my source image is the image of a deck).
Maybe having an attribute to set the anchors of the cropping and another to set the width and height would be the best for this case.

a year ago
V

Masks are what you’re looking for.
It’s not specified in TTS documentation but as TTS UI is based on XMLLayout, you can have a look here : https://www.digital-legacy.co.za/XmlLayout/Documentation#Masks

usage should be something like this :

<Mask image="mask_image">
<Panel>
<Image image="image_to_be_cropped"/>
</Panel>
</Mask>

mask_image and image_to_be_cropped should be defined as assets in the object’s UI asset manager
opaque part of the mask_image correspond to visible zone of image_to_be_cropped
First, I found it easier to both be of same dimensions but you can also play with width/heigh and position attribute when you are more comfortable with how it works

a year ago