HUD HELP : adding materials
Since I'm new to glua, I'm creating my own hud. I want to do so when u are wanted a gun icon will show up. although i have no idea how to add it into my server. Any help would be appreciated.
put the .png in the materials folder
in a server-side file do resource.AddFile("materials/path_to_file")
then client-side do local material = Material("path_to_file") do not include materials/ here as it's relative to the materials folder
in a paint hook use
I did all u said, erros don't show up, but neither the images. Did I do something wrong?
https://gyazo.com/0f640631cdf4c03a25454b7774dc5d30
https://gyazo.com/dbea5fd85ee8fdb30aaf651b28ec8080
you would put the materials folder outside the lua folder so your file structure would look like
-addons
-addon_name
-lua
-autorun
-materials
Isn't it how I have it ?
https://gyazo.com/fb609e389f7a609ba624f7cccc1bc30d
C:\Users\ZorexD\Desktop\XServers\garrysmod\addons\zhud\lua\materials
No, if you read what Zeo said materials needs to be outside of the lua folder and in the path you sent the materials is inside the lua folder. If you are going to ask for help you might want to actually read what the people trying to help you said.
If you are still confused read this page: https://wiki.garrysmod.com/page/Workshop_Addon_Creation
I listened to him, I tried it and its still wont workout for me. I read the page and everything is as it says. The image still doesnt show up.
https://gyazo.com/41784728b4174b115d19e58fd0995271
https://gyazo.com/d99852723b03e5c55f57110d55a53e27
Whats your screen resolution?
did u hook it to hudpaint or
Is that last image your full code, if so it will not work as it is not in a hook like Fluffy said. If you are not currently using a hook you should be using something like this: https://wiki.garrysmod.com/page/GM/HUDPaint
It doesnt show any erros, but shows up as a pink and black image.
If the image is pink and black that means the texture is missing so either the path to the material is an issue or something else relating to telling the game about the material.