Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Dynamic width based on text width

Discussion in 'Game Design' started by Aleshinho, May 11, 2018.

  1. Aleshinho


    May 8, 2017
    I would like to place a container in the middle of the other container like on the image bellow. unity desired layout.png The middle container would have 2 elements. First would be text that would represent price ("####" on the image), the other would be image of a coin (blue circle) with a constant width (yellow arrow).

    How can create this kind of gui knowing the price will increase, consenquently the width of inside container (red arrow) should as well? With changing of a price I would like to keep inside container to be centered ("a" on the left would be same as "a" on the right).