Texture Mapping On ImageLabels

Hello! This is my first post on the devforum so apologies if I do something incorrectly, but I want to know how I could have a similar behavior to what’s seen on regular Texture instances but instead in UI form. This is within a ScreenGui, not a SurfaceGui or anything else.

I suspect I’m gonna have to make it automatically do it within a script but that’s okay if that’s the case.

I want this so that I could have a sort of background effect in a UI only game, where it rotates or something along those lines. I don’t want to use a regular ImageLabel because of how it stretches (and using a UIAspectRatioConstraint/SizeConstraint (whichever it is) is likely going to make it look weird)

ImageLabels stretch because their default ScaleType is Stretch. There’s a Tile ScaleType that repeats the Image over the entirety of the ImageLabel. All tiled instances of the image share the two axes of the ImageLabel, so there can’t be any individual rotation, only picture-frame-esque rotation. The offset capability for Textures can be replicated if the ImageLabel’s parent has ClipDescendants enabled, the ImageLabel’s size is maintained at a size larger than its intended coverage to constantly keep 100% coverage for the intended surface area, and the Position is modified to reflect an offset texture.

2 Likes

Thank you! I did try out the ScaleType property prior to posting this, I just wasn’t aware of the TileSize property which seems to be required for the Tile ScaleType to work.

I did have to end up using the SizeConstraint property at the end (because it still stretches it due to how I assume ui elements work) but I realize I can simply scale the ImageLabel to like 1.3, 0, 1.3, 0 so that it doesn’t have the cutoff I was afraid of.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.