Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
sbs_ramim
Level 7

Centering items using LayoutGroup

I feel very stupid as I ask this but I don't know why I cannot horizontally center items on the screen. So this is what I have under my "MainScene" children node:

 

<LayoutGroup
	width="2560"
	height="500" 
	layoutDirection="horiz"
	horizAlignment="center"
	vertAlignment="center"
	>
		<Rectangle
		width="500"
		height="500"
		color="0xff0000ff"
		horizAlignment="center"
		vertAlignment="center"
		/>  
</LayoutGroup>	 

As you can see, I've set alignment as "center" in both the parent and the child rectangle, and I've tried switching between layout direction "horiz" and "vert", but still, the red square appears at the top left corner. Can someone identify what am I doing wrong here?
Thank you 

 

0 Kudos