Jump to content
Alert23

bis_fnc_dynamicText and screen resulotion

Recommended Posts

hi all,

 

i have a question, how can i set the right coordinates for the bis_fnc_dynamicText?

i use this code to display an image for example:

Clear All Rooms (image):

Task1 = ["<img align=''right'' img size='8' image='images\task1.paa' shadow='0'/>",safeZoneX+0.235, safeZoneY+0.225 * safezoneH + safezoneY, 50,1,0,222] spawn bis_fnc_dynamicText;

this is how it looks on my screen:

Spoiler

C2D4C0F5CD46EE03E189FF24864B67088BAA9BFF

 

and this is how it looks on the screen of a friend:

Spoiler

49117AF6B8F3BE77DA6E796E1397C5558FB44558

 

how can i obtain same results for everyone?

how must i adapt safezone to bis_fnc_dynamictext?

Share this post


Link to post
Share on other sites

You should use the GUI_GRID for this (or pixelGrid but meh):

#include "\a3\ui_f\hpp\definecommongrids.inc"
Task1 = [
	"<img align=''right'' img size='8' image='images\task1.paa' shadow='0'/>",
	GUI_GRID_TOPLEFT_X + 1 * GUI_GRID_TOPLEFT_W, 
	GUI_GRID_TOPLEFT_Y + 1 * GUI_GRID_TOPLEFT_H, 
	50,
	1,
	0,
	222
] spawn bis_fnc_dynamicText;

GUI_GRID_TOPLEFT_X is the same as safeZoneX, GUI_GRID_TOPLEFT_Y is safeZoneY. The important ones are GUI_GRID_TOPLEFT_W and _H. You can try around with the 1* multiplier to find a suitable location for the text.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
12 hours ago, 7erra said:

or pixelGrid

Something like...

// Pixel grid
#define SCALEFACTOR getNumber( configFile >> "uiScaleFactor" )
#define GRID_X( gridType, gridScale, num ) ( pixelW * gridType * ((( num ) * ( gridScale )) / SCALEFACTOR ))
#define GRID_Y( gridType, gridScale, num ) ( pixelH * gridType * ((( num ) * ( gridScale )) / SCALEFACTOR ))

//Size of a grid cell
#define GRID_SCALE 8

Task1 = [
	"<t size='1.2' align='left' underline='1'>TEST</t><t size='.7' align='left'><br />Testing<br />Tested</t>",
	safeZoneXAbs + GRID_X( pixelGrid, GRID_SCALE, 2 ), 
	safeZoneY + GRID_Y( pixelGrid, GRID_SCALE, 5 ), 
	50,
	1,
	0,
	222
] spawn BIS_fnc_dynamicText;

Where GRID_SCALE is the size of a grid.

Where 2 and 5 are the number of grids to place your dynamic text at.

 

So x is left hand side of the screen( safeZoneXAbs ) plus 2 grids of size 8( GRID_SCALE ).

And y is top of the screen( safeZoneY ) plus 5 grids of size 8( GRID_SCALE )

 

Where pixelGrid obeys screen resolution and games UI scale setting.

Can be replaced with pixelGridNoUIScale if you do not want it to scale with games UI scale.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Thank you guys for your help!

 

Edited by Alert23

Share this post


Link to post
Share on other sites
On 4/13/2020 at 11:34 PM, 7erra said:

You should use the GUI_GRID for this (or pixelGrid but meh):


#include "\a3\ui_f\hpp\definecommongrids.inc"
Task1 = [
	"<img align=''right'' img size='8' image='images\task1.paa' shadow='0'/>",
	GUI_GRID_TOPLEFT_X + 1 * GUI_GRID_TOPLEFT_W, 
	GUI_GRID_TOPLEFT_Y + 1 * GUI_GRID_TOPLEFT_H, 
	50,
	1,
	0,
	222
] spawn bis_fnc_dynamicText;

GUI_GRID_TOPLEFT_X is the same as safeZoneX, GUI_GRID_TOPLEFT_Y is safeZoneY. The important ones are GUI_GRID_TOPLEFT_W and _H. You can try around with the 1* multiplier to find a suitable location for the text.

hey, sry but i had to returne to this topic again because im still encountering the same problems now, calling this from a sqf works great but how would i call this via trg or debug-console?

 

Share this post


Link to post
Share on other sites
On 4/14/2020 at 12:38 PM, Larrow said:

Something like...


// Pixel grid
#define SCALEFACTOR getNumber( configFile >> "uiScaleFactor" )
#define GRID_X( gridType, gridScale, num ) ( pixelW * gridType * ((( num ) * ( gridScale )) / SCALEFACTOR ))
#define GRID_Y( gridType, gridScale, num ) ( pixelH * gridType * ((( num ) * ( gridScale )) / SCALEFACTOR ))

//Size of a grid cell
#define GRID_SCALE 8

Task1 = [
	"<t size='1.2' align='left' underline='1'>TEST</t><t size='.7' align='left'><br />Testing<br />Tested</t>",
	safeZoneXAbs + GRID_X( pixelGrid, GRID_SCALE, 2 ), 
	safeZoneY + GRID_Y( pixelGrid, GRID_SCALE, 5 ), 
	50,
	1,
	0,
	222
] spawn BIS_fnc_dynamicText;

Where GRID_SCALE is the size of a grid.

Where 2 and 5 are the number of grids to place your dynamic text at.

 

So x is left hand side of the screen( safeZoneXAbs ) plus 2 grids of size 8( GRID_SCALE ).

And y is top of the screen( safeZoneY ) plus 5 grids of size 8( GRID_SCALE )

 

Where pixelGrid obeys screen resolution and games UI scale setting.

Can be replaced with pixelGridNoUIScale if you do not want it to scale with games UI scale.

cant get this to work, i still need some help.

where would i put this part:

// Pixel grid
#define SCALEFACTOR getNumber( configFile >> "uiScaleFactor" )
#define GRID_X( gridType, gridScale, num ) ( pixelW * gridType * ((( num ) * ( gridScale )) / SCALEFACTOR ))
#define GRID_Y( gridType, gridScale, num ) ( pixelH * gridType * ((( num ) * ( gridScale )) / SCALEFACTOR ))

//Size of a grid cell
#define GRID_SCALE 8

and can i call this part then from sqf/trigger etc..?

Task1 = [
	"<t size='1.2' align='left' underline='1'>TEST</t><t size='.7' align='left'><br />Testing<br />Tested</t>",
	safeZoneXAbs + GRID_X( pixelGrid, GRID_SCALE, 2 ), 
	safeZoneY + GRID_Y( pixelGrid, GRID_SCALE, 5 ), 
	50,
	1,
	0,
	222
] spawn BIS_fnc_dynamicText;

 

Share this post


Link to post
Share on other sites
Spoiler


//description.ext

class CfgFunctions {
	class ProjectName {
		tag = "TAG";
		class Category {
			file = "TAG\functions";
			class dynamicText {  };
		};
	};
};


//TAG\functions\fn_dynamicText.sqf


#define SCALEFACTOR getNumber( configFile >> "uiScaleFactor" )
#define GRID_X( gridType, gridScale, num ) ( pixelW * gridType * ((( num ) * ( gridScale )) / SCALEFACTOR ))
#define GRID_Y( gridType, gridScale, num ) ( pixelH * gridType * ((( num ) * ( gridScale )) / SCALEFACTOR ))

#define GRID_SCALE 8

Task1 = [
	"<t size='1.2' align='left' underline='1'>TEST</t><t size='.7' align='left'><br />Testing<br />Tested</t>",
	safeZoneXAbs + GRID_X( pixelGrid, GRID_SCALE, 2 ), 
	safeZoneY + GRID_Y( pixelGrid, GRID_SCALE, 5 ), 
	50,
	1,
	0,
	222
] spawn BIS_fnc_dynamicText;


//in trigger

[] call TAG_fnc_dynamicText;

Replace TAG ( in CfgFunctions(tag and file), file path and function call ) with your own identifier.

 

  • Like 1

Share this post


Link to post
Share on other sites

Thank you it finally solved my problem after years =)

Share this post


Link to post
Share on other sites

is there also a way to ignore  "Interface size"?

because i noticed if some people changed their "Interface Size" then the text also will be offscreen or not were its supposed to be.

Share this post


Link to post
Share on other sites

https://community.bistudio.com/wiki/Arma_3:_Pixel_Grid_System

Quote

The following three script commands offer different variants of the pixelGrid:

pixelGridBase: Returns grid size based on screen resolution.

pixelGridNoUIScale: Returns grid size based on screen resolution and configs

pixelGrid: Returns grid size based on screen resolution, interface size and configs

Task1 = [
	"<t size='1.2' align='left' underline='1'>TEST</t><t size='.7' align='left'><br />Testing<br />Tested</t>",
	safeZoneXAbs + GRID_X( pixelGridNoUIScale, GRID_SCALE, 2 ), 
	safeZoneY + GRID_Y( pixelGridNoUIScale, GRID_SCALE, 5 ), 
	50,
	1,
	0,
	222
] spawn BIS_fnc_dynamicText;

 

  • Thanks 1

Share this post


Link to post
Share on other sites

thank you very much for all of your help on the forum!

this is the outcome

Spoiler

 

 

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×