unity_Text text and picture combination

Table of contents

1 Mixed text and pictures

2 The text box grows with the increase of the text and should be displayed in the center with the picture


1 Mixed text and pictures

renderings

Spend Numbers Component Settings

Front Text Anchor Settings 

Post image anchor setting

2 The text box grows with the increase of the text and should be displayed in the center with the picture

renderings 

parent object component

Put text and pictures below

 After the text assignment, add a line of code to get it done

private RectTransform _costRect;

_costRect.sizeDelta = new Vector2(_costText.preferredWidth, _costText.preferredHeight);

Guess you like

Origin blog.csdn.net/ashmoc/article/details/122951786