dgs icon indicating copy to clipboard operation
dgs copied to clipboard

dxbutton iconImage doesn't update

Open ERAGON007 opened this issue 2 years ago • 1 comments

local btn = dgsCreateButton(0.15, 0.2, 0.3, 0.2, "A simple button", true)
dgsSetProperties(
    btn,
    {
        ["iconImage"] = ":ThisResource/Files/SomeImage.png",
    }
)

The first problem is that dgs won't load the image if you simply use relative path to current resources files, e.g ("File/Images/SomeImage.png")

and the second one works but if you change the file server-side and restart that resource, the texture won't get updated

Solution: Maybe we can attach an event handler with onClientResourceStart/Stop when a file get's loaded from that resource and reload the textures loaded from that resource into dgs

ERAGON007 avatar Apr 04 '23 14:04 ERAGON007

maybe because MTA doesn't clear the cache of that path. That's why i always recommend to use dxCreateTexture

thisdp avatar Apr 06 '23 02:04 thisdp