Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dxbutton iconImage doesn't update #127

Open
ERAGON007 opened this issue Apr 4, 2023 · 1 comment
Open

dxbutton iconImage doesn't update #127

ERAGON007 opened this issue Apr 4, 2023 · 1 comment

Comments

@ERAGON007
Copy link
Contributor

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

@thisdp
Copy link
Owner

thisdp commented Apr 6, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants