Jump to content
  • 0
Sign in to follow this  
Alone

How to Add Background in Hud?

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/

Share this post


Link to post
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";
                };
            };
        };
    };
};

 

Share this post


Link to post
Share on other sites
  • 0

If you create an object from a class (which is what dialogs and displays are basically doing), the class needs to be defined somewhere. Usually this is done in the defines.hpp.
Example: If you want to you a frame, you need the RscFrame class somewhere.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...