Sorry forgot to include my custom render function which needs to be added to
hud_redraw.cpp
void CHud::DrawIconPB_Size( int x, int y, int w, int h, CHudTexture *icon,
CHudTexture *icon2, float percentage, Color& clr, int type )
{
if ( icon == NULL )
return;
//Clamp our percentage
percentage = min( 1.0f, percentage );
percentage = max( 0.0f, percentage );
int height = icon->Height();
int width = icon->Width();
int barOfs = height * percentage;
//DrawSelfCropped( int x, int y, int cropx, int cropy, int cropw,
int croph, int finalWidth, int finalHeight, Color& clr )
DevMsg("H: %d, W: %d \n" , h, w );
icon2->DrawSelfCropped(
x, y, // Pos
0, 0, width, barOfs, // Cropped subrect
w, h*percentage,
clr );
icon->DrawSelfCropped(
x, y + h*percentage,
0, barOfs, width, height - barOfs, // Cropped
subrect
w, h - h*percentage,
clr );
}
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders