Jump to content
  • 0

How to Add Background in Hud?


Alone

Question

5 answers to this question

Recommended Posts

  • 0

you would need to add a color to your background.

You most likely have a frame as part of your hpp.

This is my RscFrame

class eslk_frame: RscFrame
{
	idc = 1801;
	text = ""; //--- ToDo: Localize;
	x = 0.212281 * safezoneW + safezoneX;
	y = 0.1172 * safezoneH + safezoneY;
	w = 0.5775 * safezoneW;
	h = 0.77 * safezoneH;
};

this is by background

class eslk_bg: IGUIBack
{
	idc = 2200;
	text = ""; //--- ToDo: Localize;
	x = 0.212281 * safezoneW + safezoneX;
	y = 0.1194 * safezoneH + safezoneY;
	w = 0.5775 * safezoneW;
	h = 0.77 * safezoneH;
	colorBackground[] = {0,0,0,0.8};
};

pay attention to the colorBackground[] = {0,0,0,0.8};

the 0.8 represents 80% black transparency

If you know about HEX colors for HTML. you can use Killzone kids awesome HEX to arma code converter to choose the color you'd like

http://killzonekid.com/hex-2-arma-gui-colour-converter/

Link to comment
Share on other sites

  • 0

No Work 

This is my newhud.hpp

Quote

/*
class RscPicture
{
    access=0;
    type=0;
    idc=-1;
    style=48;
    colorBackground[]={0.2,0.2,0.2,0.4};
    colorText[]={1,1,1,1};
    font="TahomaB";
    sizeEx=0;
    lineSpacing=0;
    text="";
};
*/
class RscPictureGUI
{
    access = 0;
    type = 0;
    idc = -1;
    colorBackground[] = {0,0,0,0.6};
    colorText[] = {0.38,0.63,0.26,0.75};
    font = "TahomaB";
    sizeEx = 0;
    lineSpacing = 0;
    text = "";
    style = "0x30 + 0x100";
    x = 0;
    y = 0;
    w = 0.2;
    h = 0.15;
};
 

Error Class not exist, and server no start, 

My Descrption.ext

Quote

#include "scripts\newhud\newhud.hpp"
class RscTitles {
    
     class wm_disp {
        idd = -1;
        onLoad = "uiNamespace setVariable ['wm_disp', _this select 0]";
        fadein = 0;
        fadeout = 0;
        duration = 10e10;
        controlsBackground[] = {};
        objects[] = {};
        class controls {
            class wm_text2 {
                idc = 1;
                x = safeZoneX+0.027;//safeZoneW*0.01;
                y = safeZoneY+safeZoneH-0.16;
                w = 0.151*safeZoneH;
                h = 0.057*safeZoneH;
                shadow = 2;
                class Attributes {
                    font = "EtelkaNarrowMediumPro";
                    color = "#24FFFFFF";
                    align = "left"; // put "center" here if you want some background
                    valign = "middle";
                    shadow = 2;
                };
                colorBackground[] = { 1, 0.3, 0, 0 };  // uncomment and increase 4th number to have a background
                font = "EtelkaNarrowMediumPro";
                size = 0.06*safeZoneH;
                type = 13;
                style = 0;
                text = "";
            };
        };
    };
    class ZSC_Money_Display {
        idd = -1;
        fadeout=0;
        fadein=0;
        duration = 10e10;
        name= "ZSC_Money_Display";
        onLoad = "uiNamespace setVariable ['ZSC_Money_Display', _this select 0]";
        class controlsBackground {
            class ZSC_Status
            {
                idc = 4900;
                type = 13;
                size = "0.02 * safezoneH";
                x = 0.185 * safezoneW + safezoneX;
                y = 0.955 * safezoneH + safezoneY;
                w = 0.65 * safezoneW;
                h = 0.0330033 * safezoneH;
                colorText[] = {1,1,1,1};
                lineSpacing = 2;
                colorBackground[] = {0,0,0,0};
                text="";
                style = 2;
                shadow = 1;
                font = "Zeppelin32";
                sizeEx = 0.023;
                class Attributes {
                    align="center";
                    color = "#FFFFFF";
                };
            };
        };
    };
};

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...