Jump to content
  • 0

Bottom mainscreen image (issue)


teamcrisiz

Question

transparent images do not display correctly, why?

I have a .png file converted to .paa. it does not display properly, you only see the shadow.

 

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";
                    valign = "middle";
                    shadow = 2;
                };
                colorBackground[] = { 1, 0.3, 0, 0 };
                font = "EtelkaNarrowMediumPro";
                size = 0.06*safeZoneH;
                type = 13;
                style = 0;
                text="";
            };
        };
    };
};

sqf:

_pic = "images\bottompic.paa";
[
    '<img align=''left'' size=''2.1'' shadow=''0'' image='+(str(_pic))+' />',
    safeZoneX+0.02,
    safeZoneY+safeZoneH-0.18,
    99999,
    0,
    0,
    3090
] spawn bis_fnc_dynamicText;

at the moment I just took jpeg with a white background. this is ugly.

Link to comment
Share on other sites

14 answers to this question

Recommended Posts

  • 0

Save the image as a power of 2 in a square.

 

So accepted sizes in pixels:

 

2 x 2 

4 x 4 

8 x 8 

16x16

32x32

64x64

128x128

256x256

512x512

1024x1024

2048x2048

 

and so on.

 

I had the same issue once for my Hud, ^^ took me a while of debugging why  it happenned to me, such a stupid mistake of mine.

 

Picture of where the issue came up. 

 

RI2ibbJ.jpg

Link to comment
Share on other sites

  • 0

init.sqf

watermark = compile preprocessFileLineNumbers "watermark.sqf"; 
player spawn watermark;

watermark.sqf

_pic = "your_picture.paa";
[
'<img align=''LEFT'' size=''1.5'' shadow=''0.2'' image='+(str(_pic))+' />',
safeZoneX+0.015,
safeZoneY+safeZoneH-0.12,
99999,
0,
0,
3090
] spawn bis_fnc_dynamicText;

Have Fun!!!

Link to comment
Share on other sites

  • 0

init.sqf

watermark = compile preprocessFileLineNumbers "watermark.sqf"; 
player spawn watermark;

watermark.sqf

_pic = "your_picture.paa";
[
'<img align=''LEFT'' size=''1.5'' shadow=''0.2'' image='+(str(_pic))+' />',
safeZoneX+0.015,
safeZoneY+safeZoneH-0.12,
99999,
0,
0,
3090
] spawn bis_fnc_dynamicText;

Have Fun!!!

 

How do I add in the upper right side?

Link to comment
Share on other sites

  • 0

How do I add in the upper right side?

Adjust position values from the example. They are scalar 0.0 - 1.0, or you can think of them as 0% - 100%

https://community.bistudio.com/wiki/SafeZone

http://killzonekid.com/arma-scripting-tutorials-gui-part-3/

 

controls_positioning.jpg

 

try something like (remember min value is 0 and max value is 1):

safeZoneX+safeZoneW - 0.015, //since X axis top-right is 1, we need to remove a bit to move it left
safeZoneY+0.12, //since Y axis top right is 0, we want to add a bit to it to move it down

Link to comment
Share on other sites

  • 0

Hello,

 

I am trying to get this working but i am failing to do so. 

I have done the .hpp file, and included the file in description, also made the .sqf file, and the picture, but i doesnt showing up :(

 

here is my sqf file: http://pastebin.com/g1uaiWZt

 

hpp file: http://pastebin.com/wQWsHwPL

 

description ext: http://pastebin.com/xUT06eSY

 

Init.sqf: http://pastebin.com/uhcXnfBi

 

I dont know but is it possible that DZGM is interfering with this?

 

Can someone help me, what am i doing wrong? Thanks in advance

Link to comment
Share on other sites

  • 0

create a an sqf file, name it watermark.sqf and paste this :

_pic = "pics\pic.paa";

[
'<img align=''LEFT'' size=''1.8'' shadow=''0'' image='+(str(_pic))+' />',
safeZoneX+0.02,
safeZoneY+safeZoneH-0.18,
99999,
0,
0,
3090
] spawn bis_fnc_dynamicText;
 
 
In your init paste this:
 
 watermark = compile preprocessFileLineNumbers "custom\watermark.sqf"; 
player spawn watermark;
 
 
make sure what ever picture your using is a perfect square, 256 x 256, or 128 x 128,  
hope this helps, dont change or add anything to description.
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...