Modme Forums

How to add an image to the player’s screen? (HUD)

Game Modding | Call of Duty: Black Ops 3 | Scripting


ModmeBot:

Thread By: TrueGamerCalls
Just curious as I see other people doing it. What I mean is how do you add a image on the hud using the script. Kinda like in a few maps where when you pick up a part for the power, it will show that part on your screen, how would I do this myself?


ModmeBot:

Reply By: D-2-K
https://www.ugx-mods.com/forum/index.php/topic,15031.0.html


try this link its for power but you can edit the script as needed some additional info there for doing shield etc


ModmeBot:

Reply By: Abnormal202

void <hud_element> SetShader(<materialname>,[width],[height])</materialname></hud_element>


ModmeBot:

Reply By: mathfag
EDIT: i should have mentioned the texture has to be set to 2d

#precache ("material", "sm64_star_icon");
-zone

material,sm64_star_icon
image,i_sm64_star_icon_c



thread score_image_hud( "sm64_star_icon", 20, 255, 25, 25 );

function score_image_hud( image, align_x, align_y, height, width, fade_time )
{

    hud = NewHudElem();
    hud.foreground = true;
    hud.sort = 1;
    hud.hidewheninmenu = true;
    hud.alignX = "right";
    hud.alignY = "bottom";
    hud.horzAlign = "right";
    hud.vertAlign = "bottom";
    hud.x = -align_x;
    hud.y = hud.y - align_y;
    hud SetShader(image,width,height);
    hud.alpha = 1;

}


ModmeBot:

Reply By: TrueGamerCalls

mathfag
#precache ("material", "sm64_star_icon"); -zone material,sm64_star_icon image,i_sm64_star_icon_c thread score_image_hud( "sm64_star_icon", 20, 255, 25, 25 ); function score_image_hud( image, align_x, align_y, height, width, fade_time ) { hud = NewHudElem(); hud.foreground = true; hud.sort = 1; hud.hidewheninmenu = true; hud.alignX = "right"; hud.alignY = "bottom"; hud.horzAlign = "right"; hud.vertAlign = "bottom"; hud.x = -align_x; hud.y = hud.y - align_y; hud SetShader(image,width,height); hud.alpha = 1; }

Thank you so much!!! It helps when I get a clear example of it, <3