|
Draw var on texture
#387878
11/24/11 22:48
11/24/11 22:48
|
Joined: Sep 2009
Posts: 496
Progger
OP
Senior Member
|
OP
Senior Member
Joined: Sep 2009
Posts: 496
|
To make a speedometer i want to draw a var on a texture but how to do it is there some function to do it. Or do i have to write the function on my own? Thanks for reading and answering  PS:I also know some workarounds like changing the texture But i want to learn something new so is there a function for it WFG Progger
Last edited by Progger; 11/24/11 22:53.
|
|
|
Re: Draw var on texture
[Re: Progger]
#388073
11/27/11 22:36
11/27/11 22:36
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
I'm sorry, I don't understand your problem. Try the following code (tested) with your own model:
///////////////////////////////
#include <acknex.h>
#include <default.c>
///////////////////////////////
PANEL* panel =
{
digits(20,20,"Frames: %f",*,1,total_frames);
flags = SHOW | SHADOW;
}
void main()
{
fps_max = 60;
video_mode = 9;
level_load(NULL);
you = ent_create("object.mdl",vector(200,0,0),NULL);
panel.target_map = bmap_for_entity(you,0);
}
The panel is updated and painted every frame but the entity's texture won't be cleared/ reloaded automatically, thus you will see old values "below" the current value. You can either reload the texture every frame (could be slow, I guess), render a background panel (again with target_map, lower layer value) into the same bitmap or simply set panel's bmap to a background image.
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|