Hello Devforum! My game has a lot of scrolling backgrounds, and I want to apply one to this UI for consistency. The problem is that the background isn’t a frame, but an image.
Here’s the UI. The doodle background in the speech bubble is what I want to scroll:
Here’s my scrolling background:
So my question is, how do I make the doodles in the first UI’s speech bubble scroll like the second UI (which is a frame), while the first UI uses an ImageLabel?
I’m not actually sure if this works with CanvasGroups after doing a bit of checking. I’ll let @Reditect make a solution.
Don’t know why I’m still trying to find a solution but you could spend a really long time making it work by manually editing the pixels of an Editable Image which I have a feeling you don’t want to do.
I’d say separating the border and the thing you want to move if it’s not like that already.
I think the code you have for the scrolling effect would work the same generally. This though might be changing the UDim, if you can find a way to “mask.” Maybe Clip Descendants.
Oh, or maybe a ViewportFrame? I can’t remember if it would work, but putting a Texture and moving the offset with the viewport camera looking at the part with the texture on it.
Adding on to what is said above, you can try the ViewportFrame Masking + EditableImage approach here:
I think what @Reditect mentioned with scrolling a Texture under a mask created by the Image and a 0 alpha mesh would work. Separate and place your image’s border so it is in a higher Z-index than the VPF that you create–Reditect also mentioned this.
Sorry for replying a little late here.
The masking method is pretty hard to understand at first but it can be used for way more complex masking than what ClipDescendants and CanvasGroups can achieve albeit without support for UIs directly.
Anyways, I made a more simple UI element for creating masked scrolling images:
UI element structure: MaskImage.ColorMap is the mask image, Updater contains the modifiable attributes
Mask image used:
The transparent parts of the mask show the scrolling image while the opaque one’s carve it out