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

Cropping images#1969

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

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 :

usage should be something like this :

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

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