
Posts
5
Respect
Forum Rank
Legless Crawler
Primary Group
Member
Login Issues
Forgot password?Activate Issues
Account activation email not received? Wrong account activation email used?Other Problems?
Contact Support - Help Center Get help on the UGX Discord. Join it now!![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
so i been working on a map for a while and wanted to put in hud elements i got text based huds working fine but am having issues with making hud icons. do i need to create them as textures for referencing and also the function createicon in maps\mp\_hud_util just refuses to work it gives me unknown function and yes i tried both including it by #include maps\mp\_hud_util and calling the function from a function using a var and calling the function on it. ob maps\mp\_hud_util::createicon; also just tried calling the function directly without an object. honestly am stuck with no clue what to do to make it work.
// You need to precache the image
PrecacheShader( "SHADER_NAME_HERE" );
// In .gsc when I create an perk on my hud I do something like this:
hud = create_simple_hud( self );
hud.foreground = true;
hud.sort = 1;
hud.hidewheninmenu = false;
hud.alignX = "left";
hud.alignY = "bottom";
hud.horzAlign = "left";
hud.vertAlign = "bottom";
hud.x = self.perk_hud.size * 30;
hud.y = hud.y - 70;
hud.alpha = 0;
hud setShader( SHADER_NAME_HERE, 48, 48 );
hud scaleOverTime( .5, 24, 24 );
hud fadeOverTime( .5 );
hud.alpha = 1
// First, you need to run the function wherever you want (like in another function when a player buys something or picks something up) and you can do that with:
player item_hud_create("NAME_OF_TEXTURE");
// then just put the rest at the bottom of your script:
item_hud_create(item_texture)
{
shader = item_texture;
self.item_hud = create_simple_hud( self );
self.item_hud.foreground = true;
self.item_hud.sort = 2;
self.item_hud.hidewheninmenu = false;
self.item_hud.alignX = "center";
self.item_hud.alignY = "bottom";
self.item_hud.horzAlign = "right";
self.item_hud.vertAlign = "bottom";
self.item_hud.x = -230;
self.item_hud.y = -1;
self.item_hud.alpha = 1;
self.item_hudSetShader( shader, 32, 32 );
self thread item_hud_remove();
}
item_hud_remove()
{
level waittill_any( "end_game", "PUT_OTHER_NOTIFY_HERE_IF_U_WANT" );
self.item_hud destroy_hud();
self.item_hud = undefined;
}