0

I want to create a symbol that is a rectangle with text to the left. When I override the text, I want the total width of the symbol to stay the same. So if the new override text is longer, the rectangle will shorten to accommodate. If the new override text is shorter, the rectangle should lengthen to accommodate.

This seems like it should be really easy with Anima AutoLayout's stacks and padding, but I'm just not getting it. Can anyone help me or point me to a good tutorial on combining stacks, padding, and symbols?

Others have asked similar questions about the interaction of text and other layers in symbols here and here, for example, but none of them is asking quite the same thing.

Thanksvariable text label with accommodating text input box

  • sort of what I answered here graphicdesign.stackexchange.com/a/113413/16316 – Luciano Jan 7 at 11:22
  • Hmm. In that scenario you have the luxury of a mask that stays the same size. Not sure how that would work here. Can you explain your idea more? – Brian R Jan 7 at 18:25
  • Okay, I've thought about it a little more and I think I see what you're saying -- put the mask on the left and let the text override push some of the rectangle outside the mask. The problem with that is the border -- it would get pushed out of view so you'd have to make a thin rectangle to mimic that right border and pin it the the right edge of the mask. But that's pretty clunky. I'm hoping there's a more elegant solution! – Brian R Jan 7 at 20:18
1

It's sort of achievable with Anima:

  1. Download and install Anima, it's free to use;

  2. Create a text layer and a shape layer, group them;

  3. Tweak the settings of the text layer following the instructions on the image;Text Layer Settings

  4. Tweak the settings of the shape layer following the instructions on the image;Shape Layer Settings

  5. Select the group, in Anima's panel, click stack, set the spacing.Anima settings

  6. Because Anima will try to lock the shape layer's "Fix Size" property if you create a symbol from the group, so you can't make it a symbol.

  7. Copy and paste the group, alter the text, then Anima will rearrange for you, it will look like this;Copy and Alter

  8. Since their total width are the same, you can select them all and alter the width in the properties panel;Alter Property

  9. Kinda worked out.Done

I know this is probably not the perfect automated solution you're looking for, but Anima is not very stable, especially in symbol.

  • Thanks, Amyas. Yes, it looks like this is the best I'm going to get for now. – Brian R Jan 25 at 20:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.