Page 1 of 1
Loading new textures while the game is running?

Posted:
Fri Oct 26, 2012 18:48
by mauvebic
My text api/signs3 mod is nearly done. The only hitch is you have to restart the game for the new textures to take effect, which doesn't cut it for me.
Combine can sortof create a new texture while the game is running, so long as youre combining textures that were loaded at startup, so same problem, my texs are being generated while the game is running.
Is there anything in the API that allows for the dynamic loading of textures, or am i gonna have to start looking to patching the engine? (if thats possible)

Posted:
Fri Oct 26, 2012 23:08
by cornernote
Can you load in a dummy image and then replace that image in game? You may have to write over the image cache.

Posted:
Sat Oct 27, 2012 00:40
by mauvebic
the engine reads all the textures once at startup and that's it, no facilities to introduce new textures while it's running... which sucks cuz i can generate textures with text from within the game, i just can't use them until i restart. :(

Posted:
Sat Oct 27, 2012 09:22
by Topywo
Isn't there something in jin-xi's painting mod that generates new images?
http://minetest.net/forum/viewtopic.php?id=2588

Posted:
Sat Oct 27, 2012 10:32
by PilzAdam
This mod creates a object that contains the pixels. It doesnt create textures.

Posted:
Sat Oct 27, 2012 11:24
by jin_xi
early versions used entities for single pixels, now it does indeed generate textures, see tile.cpp
textures on entities can be switched with set_properties. so there is a node for the "canvas", and on it an entity to switch textures.

Posted:
Sat Oct 27, 2012 13:10
by mauvebic
Painting mods' no help either, uses "[combine:" which means its textures already exist at startup.
I can't use combine, since the texture doesn't exist until text2png() is called. My way has the added advantage of being able to chose font face, size and color, though as it stands the sign only shows up on restart. :/
simple white on black sign in verdana:

Posted:
Sun Oct 28, 2012 16:50
by mauvebic
Still stuck on this.

Posted:
Wed Oct 31, 2012 06:39
by sfan5
Entities can dynamically change Textures.