Game Development Community

Render number to texture.

by Chris "C2" Byars · in Torque Game Engine · 02/14/2006 (2:58 pm) · 6 replies

Has anyone gotten a way to render the current ammo count to a texture? Like this example:

guidesmedia.ign.com/guides/12289/images/halo_3.jpg
Thanks.

#1
02/14/2006 (3:28 pm)
That's just a dynamic texture I think, not a font.

Dynamic textures shouldn't be too hard.
#2
02/14/2006 (4:15 pm)
Ive got a resource im posting soon that generates dynamic textures. Check the forums for an update
#3
02/14/2006 (4:27 pm)
I know I could make say, 40 textures for that display and swap them depending on the current ammo, but that would be a lot of textures, heh.

@Peter: Sounds cool.
#4
02/14/2006 (4:31 pm)
C2

In some other games where this feature exists, the weapon is client side only.. and the counter is only needed once per client.. and the server doesn't have to care about it.

If another player walks up to you with his gun, his counter won't be shown or rendered.. because it's a different object. It's client side, and thus it's not as heavy as you might think..

This is why the Halo machinegun won't show more than it's default maximum if you edit it to something else than what it was meant to hold in ammo, because there's no textures for it and they are not generated on the fly (which would be even more heavy, no?) It's like an animation.

Edit: And for a counter like that, it would be stupid to use 40 textures. Rather 10. You reuse each texture. Like:

110 would be two different textures.
11 would be one texture.
193 would be three different textures.

etc.
#5
02/14/2006 (5:41 pm)
0-9 Ought to be enough textures. You could use IFL.
#6
02/14/2006 (7:21 pm)
Http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=9805