Archive 17/01/2023.

[SOLVED] Changing texture of a textured UIElement

Mike

I’d like to know how to change texture applied onto an already textured UIElement.

For example in example #3 (Sprites), if I modify the texture like this:

        sprite.texture = decalTex
        sprite.texture = cache:GetResource("Texture2D, Textures/LogoLarge.png")

Instead of applying the new texture, previous texture seems to be removed and the new one isn’t applied.

cadaver

You have a typo in your code.

sprite.texture = cache:GetResource("Texture2D", "Textures/LogoLarge.png")

should work.

Mike

Thanks and sorry for this one :unamused: