Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
sbs_ramim
Reel Rookie

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