• Png from HTML to Material
    7 replies, posted
I saw that it's possible save png files now. Is it possible to create a material with the png this way yet?
I think, its [code]local mat = Material('data/yoursavedmaterialname.png')[/code]
Oh cool. I didn't expect that to work since I thought the path was relative to the materials directory. Thanks.
It works, but I'm getting a big lag when I do this with those appearing in the console. [code] RELOAD [data\] "materials/concrete/concreteafloor009a.vtf": can't be found on disk "materials/detail/detail_noise1.vtf": can't be found on disk [/code] There must be a better way. This is my code [lua] local filename = name..".png" http.Fetch("myurl/"..filename, function(body) file.Write(filename,body) local mat = Material("data/"..filename, "unlitgeneric") end, function() end) [/lua]
well for a start, it doesn't look like you're saving the webpage material to png, but rather the HTML text edit: oh you're not taking the html material but literally just a png url
The image saves fine, but lag is intolerable.
Save the data to .dat file.
Looks like it will be fixed after next update.
Sorry, you need to Log In to post a reply to this thread.