Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(4 edits)

Thanks for you reply, I tried "Content Size Fitter", But it's still not I wan’t. "Content Size Fitter" will set the width of rect transform same as the width of texts, so the center of text will always stay that center of rect transform. the bottem one(Unity text) is the effect I want. 

Okay, in this scenario, please try...

Make the STM object the child of a layout group.(Horizontal Layout Group, Vertical Layout Group) and set the layout group to have "upper right" child alignment, and uncheck "child focre expand" width and height.

Next, remove the content size fitter component from the STM object, and it should follow the rules of what you want. (Within the bounds of the layout group) Unity Layout stuff works a bit strangely, so apologies for all this. It's a bit weird to set it all up.

Hi, I find the solution. I can set anchor to CenterRight and Alignment to Right to get the result I want. Thank you so much.