Jump to content

Home

HUD Coding ! :)


cb007sax

Recommended Posts

I am having trouble loading my own graphic as my hud graphic... First off, do you have to register your graphic, i saw this in a tutorial

 

//--------------------------------------------------------------------

// In Game HUD Images

//--------------------------------------------------------------------

 

yourimageShader

{

nopicmip

{

map gfx/2d/yourimage.tga

blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA

}

}

 

 

I see nowhere else in the j2k source do they do that, if i have to do that... where do i do it?

Link to comment
Share on other sites

Well, i can't find any shader definitions anywhere for shader code, why wouldn't my graphics be loading? I have like a 195x128 picture i think is the size... For the 2 images i want i get a blank picture, but all other images i put in myself work fine. I can't figure this out. . . Does jk2 only accept certain images? Here's my code

 

cgs.media.HUDCustom = trap_R_RegisterShaderNoMip( "gfx/hud/hudleft.tga" ); in cg_main.c

 

and

 

CG_DrawPic( x, y, 128, 128, cgs.media.HUDCustom );

 

in a draw function

 

And yes, i've tried many different values for the width and height, including the actual width and height, 195x128, nothing works

Link to comment
Share on other sites

In order to "trap_R_RegisterShaderNoMip" you need to have a shader. A shader contains specific instructions for the game engine on what to tell your video card to do when handling this graphic. If you only have the graphic, you won't always get the result you were looking for.

Link to comment
Share on other sites

You can use ShaderEd (included with one of the JK2 SDK releases) to make a .shader file. The .shader file goes in your PK3 in the shaders folder.

 

Look under your base folder and look in the shaders folder there, find the shader for the HUD graphic you're trying to replace, or one that is kind of like the one you want, copy the shader into a new .shader file (via notepad, or some text editor), replace all instances of the old graphic with your new one (i'd have them use a different name and path, to avoid complications), put the graphic, and the shader all in the appropriate directories inside the pk3 and see if that does it.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...