Scrollrect behaves different in android &HTML5

I just realized that ScrollRect behaves different between Adroid and HTML5. I realized this while I’m trying to create a scrolling list of sprites.

	#if js
		tmpR.y -= delta / 2;	
		compContainer.y += delta/2;				
		compContainer.scrollRect = tmpR;
	#else
		tmpR.y -=  delta / 2;
		compContainer.scrollRect = tmpR;
	#end

As you can see in HTML5 you have to move the sprite that contains all the sprites and then move oposite the scroll rect while in Android you should simply modify “y” of the rect.

Would be great if someone can check and document the behaviour of other platforms. so we can complete the documentation for easy of use.

Regards
Luis

1 Like

Small update, scroll rect seems to fail with graphics. Works ok with text fields and Bitmaps but it doesnt scroll with graphics.
Another small Update. Setting a Scrollrect in an sprite opens a Pandora Box if you are going to work with “children events” of that sprite (on both platforms HTML5 and Android).

I’m facing the same issue with html5 and scrollrects. Were able to figure out how to deal with children events? I’ve found ways to get the child sprites inside the scrollrect to render properly but the hit shapes do not update their positions as the scrollrect scrolls.