FerniFrenito Posted August 12, 2025 Share Posted August 12, 2025 Hi. I'm creating a mod for DST and I need a widget with an image. I have the widget created, but for some reason, my texture isn't showing up; it's completely transparent, I use the TEXCreator for create it, so I don't think the file is the problem. However, when I use a game texture (specifically quagmire_recipebook.tex and quagmire_recipe_menu_bg.tex), it shows up perfectly. I only changed the path for the XML and TEX files in Image(). Why is this happening? Is the game not finding my .tex file (it's in the same folder as the XML)? I know the XML is being found because it throws an error if it's not, but there are no error logs about the TEX file. I've attached the widget's code, XML, and TEX file (I just picked a random image to test). imagen.tex imagen.xml PruebaWidget.lua Link to comment https://forums.kleientertainment.com/forums/topic/167545-texture-not-showing/ Share on other sites More sharing options...
FerniFrenito Posted August 13, 2025 Author Share Posted August 13, 2025 I found a solution for creating a prefab or other object. The main problem is how assets are loaded: you need to load them before they are used, otherwise, the game can't interpret them. If you're creating a prefab, you just need to create a table like this: local assets = { Asset("ATLAS", "path_of_your_xml_file"), Asset("IMAGE", "path_of_your_tex_file"), } ... and then pass it as a parameter in the prefab's return statement: return Prefab("name_prefab", fn, assets, prefabs) This will allow you to use your texture. If you're not creating a prefab, I found this in the source code of prefabs/hud.lua: local assets ={ Asset("ATLAS", "images/fx.xml"), ... } --we don't actually instantiate this prefab. It's used for controlling asset loading local function fn() return CreateEntity() end return Prefab("hud", fn, assets, prefabs) So, it seems this is an official solution. You can create a prefab solely to use the asset loading algorithm. If anyone finds a more elegant solution, please write it as an answer. 1 Link to comment https://forums.kleientertainment.com/forums/topic/167545-texture-not-showing/#findComment-1831708 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now