#arma3_gui
1 messages ยท Page 9 of 1
I am trying to add items to a list box. I can do it through the debugger, but attempts to do so through the parent dialog onLoad event do not work. what might I be doing wrong? my logging indicates that there are indeed items that should be added to the LB.
I don't really know if the child controls are already created by engine when onLoad gets called. Try to see if the listbox control is null
I'm testing for isNull, it seems they are there. or is there a better event I can respond to in order to do that?
generally if you just createDialog/createDisplay and then instantly start adding data to listbox, it should work
it's really weird, if the control is there, then it must work ๐ค
I'm not seeing one, https://community.bistudio.com/wiki/User_Interface_Event_Handlers, if it isn't onLoad I do not know which one it is. I put some systemChat messages in, and the controls are there.
Allright, maybe you could show some code?
I persuaded it... on the LB onLoad rather than the dialog onLoad.
question re: class inherited properties... is there an enable = <bool>; or enabled = <bool>; property?
I am not sure what you mean. Do you mean if GUI config classes have an enabled property which would enable/disable the control on load?
correct. I can respond easy enough on the event itself, but I'd rather do it in the class out of the gate if I could.
saves me a few less event handlers.
I don't see this at the wiki page so probably no
there are no bools at all in config :kappa:
๐ค 0โฃ 1โฃ
You can write bool in config
"bool"
duh just use the lovely preprocessor #define TRUE 1
concerning the onLBSelChanged event, https://community.bistudio.com/wiki/User_Interface_Event_Handlers#onLBSelChanged ... what is the form for LB_MULTI style? based on empirical evidence, it clearly is not params ["_control", "_selectedIndex"]; ... when I say params ["_ctrl"]; lbSelection _ctrl; in my event handler, I get a message Error lbselection: Type Array, expected Control.
Probably it's faster to dump _this into diag_log and see what is being passed to this event handler
Than to wait till someone answers the question here...
_this passed from the .hpp is indeed the control.
and the lbselection message is not mine. that came from within lbselection.
hmm, I wonder if that has to do with A3 parameters engine? does it see one value and try to jam the two callback arguments in there? operating on that hypothesis ...
appears that maybe that is the case.
the form appears to be different from single selection to LB_MULTI, these are the parameters I am receiving... _ctrl: [Control #7212,0], _1:
the _this happening in my .hpp class, onLBSelChanged = "[_this, _selectedIndex] call KP_liberation_dialog_shareLoadouts_unitsListBox_onLBSelChanged"; appears different. perhaps in the multi use case, they forgot to deconstruct the tuple?
hmm, that's interesting, took it out of LB_MULTI, the form appears to be the same. the tuple is passed as _this.
so if I wanted to break that out, I would need to do something like this, onLBSelChanged = "[_this select 0, _this select 1] call KP_liberation_dialog_shareLoadouts_unitsListBox_onLBSelChanged";
onLBSelChanged = "[_this, _selectedIndex] call KP_liberation_dialog_shareLoadouts_unitsListBox_onLBSelChanged"```
when this event handler gets called, it gets called without any context (that is, any other local variables) except for _this, which is an array of the form `[_control, _selectedindex]`.
You, however, tell arma to pass _selectedIndex local variable straight away, before it is created anywhere
so instead you should do like
onLBSelChanged = "_this call ...";
ah, I see the difference... so the tuple is the call parameters. thanks for noticing that.
duh just use the lovely preprocessor
#define TRUE 1
No need you can write
property = true; or false
It then depends on what is expected of this property to be
There is no getBool for scripts so you canโt directly convert property into true or false, but getNumber will give you 1 and 0.
question about the timing of the onLBSelChanged event... it feels to me more like a onLBSelChanging event than a onLBSelChanged, seems to me that the state of the selection is lagging behind the actual event.
I've tried several ways to ask about the selection, from the _selectedIndex coupled with lbIsSelected, lbSelection, etc, and the state is a step behind the actual event.
which to me makes it kind of futile to respond with button enabling control, because you cannot depend upon the state being current.
has anyone experienced this? or can anyone suggest any viable workarounds?
additionally, given that this is the case, all you are provided is [_control, _selectedIndex], you cannot determine what the actual state of the selection is, whether the index was selected or unselected, for example.
ah I see. I'll try that thanks @ruby swallow
so if I understand correctly, spawn adds the handler to the scheduler, so we have state refreshed and waiting when the handler finally hits the ground running?
would'ya look at that. predictable behavior! sweet. ๐
spawn adds the code to scheduler, yes, and the code will most likely run at the next frame, or after two frames, or three, or three hundred... depending on how much loaded it is
You can replace spawn with cba wait and execute or its analogues when you make it work with spawn
Then it will be totally predictable one frame delay
I'll check that out, thank you.
How is arma text scaled? If I set text size to 1, does it make all character images have size of 1 in abs units, or is it different?
sizeEx is the size relative the control where the text is put iirc
If all text size was relative, then each control would have a different text size... makes no sense
Im having some issues with a screen display i have created. on my screen and most others it is up against the right side of the screen as intended but for people with really wide screens we have issues. below are links to the code for display and the two images for how its supposed to look and how it looks on really wide screens. I really could use some help on this.
Code
https://pastebin.com/6g0HmPWr
How it should look
https://imgur.com/a/S2n2kiz
How wrong it goes
https://imgur.com/a/haOqIV4
Look at https://community.bistudio.com/wiki/SafeZone. Here you're doing 0.6 times the screen width + the screen left border horizontal coords (0.6 * safeZoneW + safeZoneX) but you should instead do the screen left border horizontal coords + the screen width (safeZoneX + safeZoneW) and substract your controls' width so it will always be in the bottom-right corner.
@barren apex thanks im going to try that now.
@barren apex that worked. thanks mate
is pixel grid system/can be done in screen percentage?
@astral narwhal Your width is set in absolut values, that's why I doesn't scale with that 21:9 ratio.
is possible to disable scroll on controls group?
is it possible to modify the nature of how autoscroll works? Instead of the control group fading and returning to top, I'd rather just have it immediately return to top w/o fading in/out
when you select a new item in a combo box does it fire the 'action' line of the comboBox?
I don't really know but you can add a great deal of event handlers through ctrlAddEventHandler
okay I'll look into it thanks
Look at the bottom example
I think you need this one:
onLBSelChanged = "systemChat str ['onLBSelChanged',_this]; false";
yeah was just reading that
do I have to restart the entire mission for the dialog changes to take hold?
if you need the game to re-read the mission config, yes
actually you need to go back to editor
then start it again
AFAIK a restart doesn't make it re-read the config
...that's why I like to configure dialogs through SQF, because you can recompile the code while the mission is running
Ah I see
so instead of doing it in config, you can run a script when dialog gets opened, in that script you can add event handlers through ctrlAddEventHandler
yeah that sounds like a great idea - antistasi takes a bit to load up each time
My dialog's default button is flashing, and I can see no refernce to such behaviour in the Biki, can anyone point me in the direction of making my buttons NOT flash ? ๐
Letโs bring that crystal ball ๐ฎ
You mean it is changing color periodically?
You have not set up all colors of it I suppose
https://community.bistudio.com/wiki/DialogControls-Buttons
Check colorFocused and colorBackground
How do I make it so I can move in a dialog but still be able to click the dialog?
I am trying to add more options to the eg spectator camera so I want a display over it hiding the normal display of eg spectator cam
But I can only move my camera with scroll and not wasd
you cant
all those camera dislpays have actual script to let you move camera
i guess you could call whatever the normal spectator thing uses
I've seen it on a video before, not sure what they used for camera if it was splendid or eg spectator, but they had a moving camera with a custom dialog that has a player list etc.
(no mods)
Any idea how they did it?
Sparker. After some trial and error it has something to do with the background active and focused. I am getting a "blinking" effect which is not what I want at all.
If you set the same colors, you will not get blinking
I changed my code and instead of using an existing free cam I used this to create the free cam. (works fine)
_camera = "CamCurator" camCreate eyePos player;
_camera camCommand "maxPitch 89";
_camera camCommand "minPitch -89";
_camera camCommand "speedDefault 0.1";
_camera camCommand "speedMax 2";
_camera camCommand "ceilingHeight 5000";
_camera camCommand "atl off";
_camera camCommand "surfaceSpeed off";
_camera CameraEffect ["INTERNAL","Back"];
cameraEffectEnableHUD true;
Anyways, I can still not control wasd, I am guessing the dialog I made is blocking it somehow.
How can I solve this?
Fixed this by making camera controls from scratch, still don't know how eg spectator did it. Haven't found any code of their movement not even the splendid camera one. Been looking for it for months.
still don't know how eg spectator did it
If only one could see BIS source files... oh wait
I did find the eg spectator files
Didn't find anything about their movement
Haven't found any code of their movement
How do I set individual colors for my Toolbox (type 6)? I have 5 Images and I want specific colors for them.
can an R2T Texture be applied to a Static control with ST_PICTURE as the style? I can't seem to get it working in my script
It can
I know ice done it in the past but for some reason it won't work for me now
I'll send the dialog control class and script when i get a chance
here is the class:
class helmetCam_r2t_st : RscPicture
{
idc = 2306;
x = 0.74375;
y = 0.556;
w = safeZoneW * 0.2;
h = safeZoneH * 0.2;
text = "#(argb,512,512,1)r2t(helmetCam_r2t,1.0)";
//text = "#(argb,8,8,3)color(0.6,0.6,0.6,0.5)";
tooltip = "Helmet Cam Feed";
style = ST_PICTURE;
};```
and here is the script
```sqf
if (isNull _unit) exitWith {
if (!isNull cain_helmet_camera_object) then {
cain_helmet_camera_object cameraEffect ["Terminate", "BACK", "helmetCam_r2t"];
camDestroy cain_helmet_camera_object;
};
};
//Create camera if not present
if (isNull cain_helmet_camera_object) then {
cain_helmet_camera_object = "camera" camCreate [0,0,500];
cain_helmet_camera_object cameraEffect ["Internal", "BACK", "helmetCam_r2t"];
};
You variable is undefined, so nothing will work. You need to execute cain_helmet_camera_object = objNull; somewhere before you try anything
Hello! Is possible to hide mouse cursor in dialog?
That looks good @silver nacelle
Thanks @vital warren
@silver nacelle looks great
How do I setup the scriptPath for BIS_fnc_initDisplay? The only reference to CfgScriptPaths on the whole wiki is on the wiki page for BIS_fnc_initDisplay
I also couldn't find any results on the forum for CfgScriptPaths
path is either in the Engines internal folder structure or the mission folder acts as the root folder you can run scripts from
what is it that you are trying to do?
Im modifying the splendid camera and running my own function to limit where it can go
Going to recreate the arma 2 construction interface
Here is the original display class for the camera:
scriptPath = "GUI";
onLoad = "[""onLoad"",_this,""RscDisplayCamera"",'GUI'] call (uinamespace getvariable 'BIS_fnc_initDisplay')";
onUnload = "[""onUnload"",_this,""RscDisplayCamera"",'GUI'] call (uinamespace getvariable 'BIS_fnc_initDisplay')";```
So I'm guessing scriptname is literally just the sqf file name?
GUI would be the folder its contained in
Or would scriptname be the function name?
aha, I found it. Scriptname is the name of the file, path is the variable defined in CfgScriptPaths. in the ui_f.pbo
I'm lost!
What is the correct style of a static text which can be selected but can't be edited?
Oh nvm it's not style, it's a canModify property of an edit-type control
When creating a custom gui, through the ingame gui editor: Elements position gets defined as "somevalue * GUI_GRID_....". When trying to show the UI ingame, my display gets created, but I cant see any of the elements. Any thoughts?
Changing the position to use "somevalue * safezone... + safezone..." makes it show up
You need to define GUI_GRID_WHATEVER with a macro iirc
Great, I'll try to find out what it should be defined as ๐
Found it! Didnt find a shortcut to export it directly, but using Ctrl + S -> select "Grid Macros" as format -> Paste clipboard into defines.
๐
how do you newline again in a standard text element, or you need a different control / structured text for that?
In static text you mean?
It must have a multiline style
And lineSpacing property IIRC
Example
idc = -1;
x = 0.00000066;
y = 0.05000038;
w = __WIDTH;
h = 0.08;
style = 0+16+512;
text = "Enemy radio cryptokey was found!";
font = "PuristaMedium";
sizeEx = 0.04;
lineSpacing = 1;```
Then newline is the usual "\n" in string
Or if it doesn't work then
_endl = toString [13,10];
@agile sinew
Yes, plus the noframe style(or how is it called), otherwise it has this weird frame around it
Can anybody teach me whats different between GUI and IGUI?
GUI is a graphical user interface
What is IGUI then?
interactive grafically user interface
so a static text would be a GUI and a button and IGUI
that's how I define the difference
but then again, it doesn't matter in arma
One assumes user to push something, another one doesn't? ๐คท
@ocean hazel do you have the noframe part at hand please
sure ๐ค
ahh the wiki is ded
Should be this thing #define ST_NO_RECT 0x200
yes, or 512 style as I mentioned above, should work, doesn't it? does it still show the annoying frame?
so should be
style = 16 + 512; (or its equivalent with defines)
style = ST_MULTI + ST_NO_RECT;
tx
@quiet arrow thank you for the answer
Was wondering where i can find handle for chemical detectors screen and spectrum device's screen.
for ctrlCreate is there a way to create the control in the background controlGroup, I noticed you can input a controlgroup but not sure how to put it into the default background one
reason i'm trying to do this is I have some controls already defined in the display class, and I don't want these new controls created via ctrlCreate to display over it
got it working creating a dummy control group that i add to with ctrlCreate
although if anyone has a better way of doing it ill be glad to hear it because doing it that way screws up all the positions of the UI elements ๐ฆ
You mean it screws up all the positions of the elements you add into the dummy control group you've mentioned? Positions in the group are relative to group's origin, not display's origin. Therefore if you align the position of the group with display origin, the coordinate systems will be aligned. @empty mountain
Yeah, I did that but I got some weirdness where elements were getting cut off despite the group/display taking up the entire screen
Cut off with the group switching on its scroll sliders?
No I used the control group without sliders but maybe
this is how it looked: https://cdn.discordapp.com/attachments/515032784549445632/640775720783839252/unknown.png
and how its actually meant to look(after i did another workaround) https://cdn.discordapp.com/attachments/515032784549445632/640790518527426570/unknown.png
Ah yes I understand, if group is positioned at (0, 0), it's actually not the top-left of the screen, but top-left of the 'viewport', that's why :(
like the first one was x = 0, y = 0, w = safezonew, h = safezoneh etc
ohhh
is there a way around it?
Sure
like it doesnt matter now as I just made dummy controls for the two controls with the layering issue and that dealt with it
but for future reference
X = safezonex; y = safezoney; will put the group in the top-left corner.
But then you will have to take into account this offset in all the child controls of course.
mmm yeah when I did that i got this : https://cdn.discordapp.com/attachments/515032784549445632/640775238342279199/unknown.png
but I didnt try offsetting the child controls
I thought I was just missing something with the control group
Well, if you tried, then it would work.
would it be as simple as adding/subtracting safezoneX etc from the child controls positions?
Yeah
is any event handlers for rscEdit ctrlText changed?
If not, you can compare previous and current text on each frame
Another alternative is to add keyboard event handlers
@ocean hazel @barren apex thank you! I will try that method
onChar is working, but have problems
i take ctrlText from edit and add _charCode
but when i use Backspace button to replace - script don't working
and taking this
i think the best solution on this case - just run script with onMouseMoving on with cycle
Why not on each frame then?
i don't like onEachFrame ๐ when use that - getting low fps
ah, get it working, i think) just added event for Backspace
on edit control
but have another question ๐
Not rly if it's only active when your dlg is open, gettext and compare strings is less than 100 microseconds I believe.
Anyway I think that if you are having your own dialog, you should rather use the key down EH. I was thinking it would be getting too complicated to check if for instance the edit box is in focus or user is pressing the printable characters, but probably you can ignore these checks and just run your stuff regardless of these checks
as i understand - onChar is event handler special for rscEdit when is not focused - script it not working
Use keyDown/Up to detect backspace then
https://i.imgur.com/XcUgWxG.png does anyone know how to create this kind of element? I want to use it for my module's attributes
can be done with a ControlsTable https://community.bistudio.com/wiki/DialogControls-ControlsTable
Is there a way to trigger TreeView control filtering via script?
you can use idcSearch to a invisible Edit control and then via script change the text in that control to trigger a filter, but is there a scripted way without the seperate edit control?
I assume there simply is no way
Not that I know of
yep, I think there's no way to trigger it directly by script
but for me with bigger TreeTiew controls the idcSearch is pretty much unusable because it laggs/stops the whole arma exe
Yeah thats my point. I want to fix that lag/freeze
the rendering of the control itself is far from optimized, too
have a control with a few 1000s entries only slightly visible and I can hear my fans spinning up
tree view control has alot of perf issues
An edit box with lots of text slows down arma as well ๐คท
Well, lots like... a hell lot, but still
My focus is only making zeus usable without freezing for 5+ seconds everytime you wanna do whatever
If that means I have to optimize all treeviews, then so be it
make a new control type ๐ฌ
someone be cray cray.
Custom control support is on my intercept todo list, but... I doubt that will ever happen
Custom control which can stream pictures from outside of the game confirmed (not)
I assume there simply is no way
Basically no
In my object placement mod the invisible control setting text filter with a delay is exactly what i do
even then with a lot of ptions in it its still just way too slow though
bigger TreeTiew controls the idcSearch is pretty much unusable because it laggs/stops the whole arma exe
I think I have a fix for that, will be included in my zeus fix. Makes treeview filtering multithreaded
And its done. Pushed into my Zeus caching mod.
It makes filtering for all top-level nodes in parallel. So if you only have one top level node it does nothing, but in Zeus where each faction has a node it works quite nicely.
is than an intercept thing?
i probably should've just done my library searching in python.... seeing the library is loaded through python in the first place.
no. Explicitly removed intercept dependency cuz I wanted it to be dependency less.
0 dependencies.
https://youtu.be/cV2S4qdXZtg Its this ridiculous.
Okey I forgot to write in the video which side is what, but its pretty obvious
Included in my ArmaZeusCache mod
Yes! Exactly!
Awesome work Dedmen. It's a shame stuff like that has to be fixed by community.
Is there a yt tutorial how to make guis for arma?
That is not a yt tutorial though
oh yeah right, but I think he edited his request
I would say, there is no best way to make GUIs, best you can do to teach yourself is to get familiar with this page: https://community.bistudio.com/wiki/Dialog_Control
Then have a look at available types, and have a look at control API (all functions which start with ctrl, control, display, or have these words in them)
is there a way to make GUI the same size (elements and text) for all screen resolutions (excluding multi monitor setup) AND interface sizes?
so you have a button is 10% of screen (width and height, with text the same)
(not 100% precise but to keep the relation basically)
Sure
For same distance in % from the border:
(X * (getResolution select 0) / 1920) * safeZoneW + safeZoneX or something like that I think
You can always scale control
Did it like that actually: https://github.com/CoopR-Mod/CoopR-Mod/blob/fix/coopr-131/addons/core/coopr_gui_base.hpp#L23-L29
But this will not keep the ratio on the width and height but should be fairly easy to fix I guess
0.1*safeZoneH is 10% of whole screen height
0.1*safeZoneW is 10% of whole screen width
you can set your text height as 0.04*safeZoneH and it will be the same size relative to screen height
@agile sinew
IF you want to try these numbers fast, try ADC (Arma Dialog Creator), it does rendering like in arma
thanks guys! to give some more context: from A2 days people recommended to use:
x = "(7.5/100) * SafeZoneW + SafeZoneX";
y = "(7.5/100) * SafeZoneH + SafeZoneY";
w = "(85/100) * SafeZoneW";
h = "(85/100) * SafeZoneH";```
to have this relative addressing with `sizeEx = "0.10 / (getResolution select 5)";` to scale text
so with A3 the pixel grid stuff came up
however i was told that you cannot get UI elements and their text remain the same regardless of resolution and interface size
so size and positioning - most importantly in buttons, lists and other more complex UI controls
ive seen that A3 uses a combination of getResolution parameter for example for text size
to be very specific: https://i.gyazo.com/f45ad16f9c6e82f622d0e5d99d2346d5.png
can you make this look exactly/nearly the same - no matter RES/x-y relation+overall screen space and IGUI size (leaving multi monitor or other special cases out of the picture)
I guess you can, you'll still have to deform some element if the aspect ratio of the screen changes but you can chose wich one you want to deform or not (some example: https://imgur.com/a/0lx2PQI)
For text there's surely a way to keep it the same
yeah, no way around that (unless you use the absolute pixel (grid approach)) from what i understand
so you either get some stretching, or you leave a bit free area on the sides
Definitely possible: https://imgur.com/a/70fsP86 (screenshot taken in arma)
A bit fastidious but at least, everything looks the same (or almost) on all screen
well make sure to show also text and use different elements like buttons, list, control groups, etc
their positioning of text is the tricky thing
Yeah but I haven't figured out how to correctly convert text size yet Text is easy in fact, same way as you would to to set the height of your control
Inside controlsGroup too since nothing changes except the position referent. Text seems to work too, in list at least, but sizeEx is sizeEx everywhere so no reasons for it to not work.
Here's the test GUI with a list and a button with text inside (some control are not aligned on resize but that's just because I didn't make them do that, take example on joinButton if you want): https://pastebin.com/ACQf9tND
preface: my last testing is from A2:OA days
the reason i am asking for these specifics and actually tested is that back then some of these controls didnt "center" properly (could have be just me too ofc)
so its not about theory, or what can be done, yet if it actually works or not
Do you mean they might not align perfectly to pixels?
Like some are 1px wider, some have 1px gap in between them?
no not that small details
No, you cannot make them looks exactly the same on all screen, you'll either have some free space or some stretching. What you can do is chose what will be stretched and how to make them look nearly the same.
I don't know what you mean by "not centering correctly" but if you say that a control should be 50% of the screen width and start at 25% of the screen, it will always do, maybe 1px of but that's all
as said aware that exactly same is not possible. its about the text positioning what i am asking someone to confirm
control size is also not the issue. that all works since A2, but as said back then certain controls acted weird with text positioning in different IGUI size - screen resolution combos
anyone has insights how to do the nearly 1:1 GUI regardless of screen res/ratio and IGUI/interface size setting?
You mean... the problem you were describing above?
Maybe you can describe what is not working how you want it to?
1:1 in relation to what, screen? Cant do that as screen could be different aspect and event triple head
you can absolutely do in relation to viewport
as it is always 3:4
but viewport depends on UI size
so the fonts depend on teh size of viewport
so your question is quite ambiguous
Maybe you can describe what is not working how you want it to?
I'll drink to that!
basically using getResolution in specific ways one should be able to adjust interface to all combos to be basically the same
yet it seems no one actually knows what it is
BI itself seems to use also different setups
Make a 1:1 dialog on all screen is impossible, if the Aspect ratio of the end user differs from the aspect ratio on which the dialog was made, the element will be deformed (but not their position). You can do some math and then decide how you want your element to resize and place themselves.
as said "nearly"
again not 1:1
_resX = getResolution select 0;
_resY = getResolution select 1;
_currentResolution = getresolution select 1;
_coefRes = ((round ((getResolution select 1) / 180)) / 4) max 1;
_currentAspect = getResolution select 4;
_coefUIScale = getResolution select 5;//_currentUISIze
_pxW = 1 / (getResolution select 2);
_xMod = (getResolution select 2) * 0.00001;
_pxH = 1 / (getResolution select 3);
(_this / (getResolution # 5)) * 0.7
case ((getresolution select 5) > 0.8): {}; //--- Exit on Large and Very Large UI sizes, there's no space on the screen
///
rowHeight = "DDD * (1 / (getResolution select 3)) * pixelGrid * 0.5";
size = "DDD * (1 / (getResolution select 3)) * pixelGrid * 0.5";
sizeEx = "DDD * (1 / (getResolution select 3)) * pixelGrid * 0.5";
sizeEX = "DDD * (1 / (getResolution select 3)) * pixelGrid * 0.5";
sizeExUnit = "DDD * (1 / (getResolution select 3)) * pixelGrid * 0.5";
///
x = "((getResolution select 2) * 0.5 * pixelW)";
x = "((getResolution select 2) * 0.5 * pixelW) - (DDD) * (pixelW * pixelGrid * 0.50)";
x = "((getResolution select 2) * 0.5 * pixelW) + (DDD) * (pixelW * pixelGrid * 0.50)";
x = "((getResolution select 2) * 0.5 * pixelW) + (DDD) * (pixelW * pixelGrid * 0.50) - ((DDD) * (pixelW * pixelGrid * 0.50))";```
this is BI usage in A3
/* CHANGE THOSE 2 BELOW IF YOU'RE DESIGNING YOUR GUIS IN ANOTHER SCREEN FORMAT */
#define ORIGINAL_SCREEN_WIDTH 1920
#define ORIGINAL_SCREEN_HEIGHT 1080
/* HORIZONTAL ADJUSTEMENT MACROS */
#define X_POS(X) (((X * (getResolution select 0)) / ORIGINAL_SCREEN_WIDTH) / (getResolution select 0))
#define X_FROM_LEFT(X,W,H) (X_POS(X) + WIDTH(W) - WIDTH_FROM_HEIGHT(W,H))
#define WIDTH(W) (((W * (getResolution select 0)) / ORIGINAL_SCREEN_WIDTH) / (getResolution select 0))
#define WIDTH_FROM_HEIGHT(W,H) (((W / H) * ((H / ORIGINAL_SCREEN_HEIGHT) * (getResolution select 1))) / (getResolution select 0))
/* VERTICAL ADJUSTEMENT MACROS */
#define Y_POS(Y) (((Y * (getResolution select 1)) / ORIGINAL_SCREEN_HEIGHT) / (getResolution select 1))
#define Y_FROM_BOTTOM(X,Y,W,H) (Y_POS(Y) + HEIGHT(H) - HEIGHT_FROM_WIDTH(W,H))
#define HEIGHT(H) (((H * (getResolution select 1)) / ORIGINAL_SCREEN_HEIGHT) / (getResolution select 1))
#define HEIGHT_FROM_WIDTH(W,H) ((H / W) * ((W / ORIGINAL_SCREEN_WIDTH) * (getResolution select 0))) / (getResolution select 1)
That's how I did it, it takes pixel as input because it's easier for me but as long as I use the correct macro for each element, the UI will basically look the same. Maybe not the best solution but it works great so far
And for text is use the same command that I used to define the height of the element but I change the Pixel height
And I may have forgot some steps in those but cannot get my hand on my latest iteration
this is what AWAR has been using: https://pastebin.ubuntu.com/p/tWG924s8xz/
@barren apex thanks. for my understanding: with these you hardcode to a specific screen ratio, no?
#define ORIGINAL_SCREEN_WIDTH 1920
#define ORIGINAL_SCREEN_HEIGHT 1080
Yep, the dimensions in which the dialog was made
And the other macros are just a bunch of Rule of 3 (idk how we call that in English ยฏ_(ใ)_/ยฏ) to get how much of the new screen in percent this represents
you have to deal in percentages, design your UI where each element size is a percentage of. height of the element is % of screen height, width is a % of screen width. only then your UI will fill whole screen and will align to aspect ratio. Of course you will have to show it only on the middle screen of the triple head
will suck if you have a strict circle or square to display
Multiplying by (3 / 4) or (4 / 3) could work but then you may run into other issues
is there a way to adjust/test the ui scale withoug game restart?
Windowed mod and then change the res in the video settings
sorry i think you misunderstood - the ui scale i asked
not screen res/ratio
// SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
// sizeEx = "5.5 * (1 / (getResolution select 3)) * pixelGrid * 0.5";
sizeEx = "0.04 / (getResolution select 5)";
so i tried these three, the first two are from BI+A3, 3rd from A2 (BI?)
only the last keeps the text size same regardless of ui scale/IGUI size - which makes sense as getRes 5 returns the factor
What Heyoxe said only change UI scale
can one call a function from these fields?
like to have not as verbose and repeating code?
I think yes but doesn't hurt to try
idea is to have a switch case handling for aspect ratio to normalize any setup to an unified modifier
also any clue if for config defined (rather than mission specific) is "getResolution select X" evaluated only once at game start, or for every mission loading
Every time you open the dialog i think
Every time you run the command to be more precise
hm will do some tests tomorrow
class CA_BackgroundWeaponTitle: RscText
{
colorBackground[] = {"(profilenamespace getvariable ['IGUI_BCG_RGB_R',0])","(profilenamespace getvariable ['IGUI_BCG_RGB_G',1])","(profilenamespace getvariable ['IGUI_BCG_RGB_B',1])","(profilenamespace getvariable ['IGUI_BCG_RGB_A',0.8])"};
idc = 1001;
x = "0 * (((safezoneW / safezoneH) min 1.2) / 40)";
y = "0 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
w = "10 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
sizeEx = "0.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
};```
does someone understand the BI system here?
safezoneW / safezoneH gives you the screen aspect ratio, the min 1.2 is probably a limiter for 3 monitor setup or 16/10
the first number for positioning and width/eight - but in what scale/reference
like 40/25 grid - how does his system work/translate to designing dialogs?
These expressions are the result of preprocessed macros, so it might be difficult to see why when unfolded
well i have the macros, but these arent telling either
hi, how can I add a new "item slot" to the inventory which can hold one item?
similar to the radio/map slot but all types of items are allowed in it
@granite berry wrong channel - check #arma3_config
sizeEx = X * (getResolution select 4) / (getResolution select 5);
is what we have atm. seems to work across all screen aspect ratios and interface sizes/ui scales
hey, i know that pic ๐
And yeah, this worked in Windowed mode and different Resolutions+InterfaceSizes.
- Left/Mid: 16:10 - InterfaceSize: normal + very small
- Right: 16:9 - InterfaceSize: normal+very small```
Hey so I wanna start into GUI making for my mission. To start off I have a script that will check the status of 5 helicopters, The Status are "KIA", "BUSY", and "AVAILABLE". I do I get this script to relate with the interface?
Here is the script in question ```sqf
_Area = Getpos CentreMass;
_HeliAll = nearestObjects [_Area, ["RHS_UH60M_d"],6000,true];
{
_landPos = (getPosATL _x select 2);
_SeaPos = (getPosASL _x select 2);
_HeliName = name _x;
_Status = "unknown";
_EngineStat = isEngineOn _x;
if ((_landPos > 1) OR (_SeaPos > 22.5) OR (_EngineStat isEqualTo True)) Then {
_Status = "BUSY";
if (!Alive _x) then { _Status = "KIA"; };
} Else { _Status = "AVAILABLE";};
Hint Format ["%1 is %2",_HeliName,_Status];
sleep 3;
}ForEach _HeliAll;
Here you have all the commands related to GUI: https://community.bistudio.com/wiki/Category:Command_Group:_GUI_Control
Assuming you're using a normal text, ctrlSetText is what you need
is possible to disable scroll on ctrlGroup control?
Yep, set scrollSpeed to 0 in Vscrollbar, hscrollbar iirc
Use RscControlsGroupNoScrollbars
Isn't the idc also the value which button is in front of the other and if button a's idc is higher then button b's it should trigger button a? with a buttonclickeventhandler
I don't think so. Only the order in config matters
They're drawn from top to bottom
Thanks for the quick answer, it is working now
Second goes on top of first, third on top of second,... etc
UNLESS you click on the first one, then it pops up to the front.
^
So you background should go into
class ControlsBackground, not class controls
Unless you use ctrlenable false on non interactive controls
is more or less "select"
with some limitation. You can use select instead, if you want
ok i will accept that, but I' never heard about that
oh wow
Yeps, i like it. Instantly switched over to use that, when possible (non-macro stuff)
But, if I add this line, the button is kinda black shadowed
like in the gui editor black but it is set to transparent
check the colors
Button is interactive element you supposed to press, why you want to disable it?
enable when ceratin conditions are met, for example
But for this case, i would go with ctrlEnable
I would like to press it, but not that it gets moved in front, there are two buttons, one that covers the complete area and another one that covers only a certain area
Doesnโt make sense
Yeah, not rly
Ok give me a second
[link deleted]
I want to give a hint if you touch the area of the board. But I want to do something else when I touch the red wire on the right
hm
Use the mouseClick EH and check if it's in the area
that sounds good
Buttons are a bad choice for this
What should I use instead?
Mouse moving
currently thinking about onMouseEnter
Will give you coordinates
combined with inArea / inPolygon check
Use inPolygon command
inPolygon = define the outer edges of the Red Wire -> if mouse is in there -> set a variable to "true".
In MouseEH -> if(var)then{dostuff}
and how do I define the areas? The given coordinate are the one but the values to compare
(easiest example)
You can log coordinates with some mouse click EH
Oh yes that was too simple
โ๏ธ
Or let a hintsilent run constantly ๐
Okay, log when clicking is much easier :notlikethis:
Use controlsGroup maybe so that it wonโt be affected by position on the screen
I'm a newbie in gui's I think you need to explain it a bit more for me
ctrlgroups is another set of nightmare (pretty usefull though)
Elements inside controlsGroup are relative to the group
Means: You create 1 ctrlGroup at coords [0.5,0.5], each ctrl inside that controlgroup with X/Y = 0 -> Will be at [0.5,0.5]
Oh that is perfect
It's kinda like, as if you create a new "safezone"
Basically you need to experiment with UI stuff and EHs until you find what youโre looking for
Yeah. And don't get frustrated ๐
Ok guys, thanks i highly apprechiate the your help
Hey. On my dialog I have 2 list boxes, both with variables, and a request button that links to a call. How do I get both of these lists boxes into [something from list 1, something from list 2] call Function?
lbValue, lbCurSel?
you reckon this will work?
action = "[[lbText [1500,(lbCurSel 1500)]],[lbText [1500,(lbCurSel 1501)]]] Spawn Sov_Fnc_FlyTo"
No, second one reads from the same box as first
if I was to use lbValue instead of lbText. what difference would it make?
When you set value you canโt see it unlike the text which you can see
ok. I'm not sure what I'm doing wrong. I have lbAdd for the text, But when I select the text to send to the script, it seems like it sends a string to the script in stead of the Heli
so when i check with Hint it says objNull, 0
objNull should be a Heli and 0 should be the marker where the lz is.
could lbSetData work?
No
You canโt store object in lb but you can store variable name as string and use that later to get your object from a variable
ok so i'll change up my function to accept the string. but do i store it with lbSetData?
Yes you can
To do what? I have no idea what is your goal
Yeah, fair enough. My main goal is to create a dialog which allows the user to select a helicopter from a pool of helis on the carrier, then fly that heli to the LZ which the players selects.
Is the helicopter already created or is created on demand?
already created.
So it is AI helicopter you want to send on a mission?
yep
Is it editor placed?
yes
So you can give it a variable name in editor then access object through
_heli = missionNamespace getVariable [_yourlbdata, objNull]
Where lbdata would be variable name from editor
so i call _heli = missionNamespace getVariable [_yourlbdata, objNull]
in the script that opens the dialog or call it in function that sends the heli on its task?
probably the last one. And let me assure you, I'm no claivoyant
Well I do thank for your assistance.
Ok so right now I am using
[[lbData [1501,(lbCurSel 1501)]],[lbData [1500,(lbCurSel 1500)]]] Spawn Sov_Fnc_FlyTo
this is meant to pass into my function. but according to hint I am getting nothing passed through.
For debuging:
In the listbox configs, try:
onLBSelChanged = "systemchat str _this";```
Have you lbSetData your data?
@weary imp yep
@placid osprey I'm pretty sure the devs said (somewhere) that they'll fix that. but anyway. my problems now looks like it isn't sending the lbData to the script when i call it.
Fix what?
the ping
Ah, kk.
Try the alternative lbData way
https://community.bistudio.com/wiki/lbData
Alternative Syntax
_control lbData _index```
yeah i've tried that.
That's the one i am using all the time (currently too, btw).
Can't remember why i didn't used the main syntax ๐ค
Check if it finds the ctrl systemchat str [_ctrl]; (why brackets? because: empty strings don't show up as msg ๐ So even if there is an empty string ("") -> [""] <- output)
- systemchat ANYTHING, if you have no clue, where the problem might be. Begin from the start of the script, then go down, until you found it.
ok. i am on something. the ctrls are not showing up
SO. turns out the script can not find _ctrl = (findDisplay 99999) displayCtrl 1500;
systemchat str [_ctrl]; <--- !! Always use that ๐
YES! YES! I found out what was the problem. it was because i was closing the dialog before it was sending the _ctrl's data
Nah mate. I'm feeling big brain after this.
https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcSlJx7SgvTTD41LJ9TXiHu1-HH0kazuEU1tFJqwb9xBtfrXudc3
Since you closed the dialog and deleted every var in it ->
https://i.pinimg.com/originals/59/af/22/59af225e830dd7476b476c18a0369fe9.jpg
๐
(happens to everyone, all good man ๐ )
How do I update a RscStructuredText?
@weary imp thanks again pal.
@short grail
https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3
bookmark it.
Press Ctrl+F -> type "ctrl" -> All the magic commands
is possible to make controls group in another controls group?
Probably
Yep
@short grail you can delete this post now https://discordapp.com/channels/105462288051380224/616327617725071373/650206518267871243
Sup guys, I've been gone a while. Lost all my old files, and now im trying to do something I've done before but isnt working for some reason.
It's a UI on top of a camera view using create display. Im trying to use a a rscText to create a mouse area that can be clicked on. I know its most likely something really dumb.
Be grateful if someone can figure it out.
#define true 1
#define false 0
class RscRtsMain
{
idd= 80000;
movingEnable = false;
enableSimulation = true;
fadein=0;
duration = 1e+011;
fadeout=0;
onLoad= "_this spawn RTS_fnc_InterfaceOnLoad;";
controlsBackground[]=
{
RscBackScreen
};
controls[]=
{
RscMouseArea
};
objects[]=
{
};
class RscBackScreen: IGUIBack
{
idc = -1;
x = 0 * safezoneW + safezoneX;
y = 0 * safezoneH + safezoneY;
w = 1 * safezoneW;
h = 1 * safezoneH;
colorBackground[] = {0,0,0,0.2};
};
class RscMouseArea: RscActiveText
{
idc = 80001;
text = "";
x = 0.25 * safezoneW + safezoneX;
y = 0 * safezoneH + safezoneY;
w = 1 * safezoneW;
h = 1 * safezoneH;
action = "hint ""Good job""";
onMouseButtonDown = "[_this] spawn RTS_fnc_MouseBtnDown;";
colorShadow[] = {0,0,0,0.5};
};
};
ive tried both rscText and ActiveText and also onMouseButtonDown and onMouseDown
also tried adding them through EH. That's the fnc that's called onLoad
The action on the active text works when i hit space bar over the ctrl
@valid dirge why u not use rscButton?
try add [_this] spawn RTS_fnc_MouseBtnDown; to action
Bc I also need mousebuttonup and for it to return which mouse button was pressed.
@valid dirge try just delete a action = "hint ""Good job""";
Working till later TN, but I'll check when I get home. Could swear I took it out for rsctext and tried but we'll see.
does anyone have an up to date list of properties for the map gui control?
arma is giving me errors about missing stuff that's not in here https://community.bistudio.com/wiki/Dialog_Control_Map and it's kinda hard to fix it without even knowing what type the missing element is supposed to be
This mod has an option to export all gui base classes. https://steamcommunity.com/workshop/filedetails/?id=623475643
including the ones the gui editor export omits? i have that already but i just assumed it was the regular gui editor export
oh my, it does indeed, thanks a lot, this made my GUI editing about 1357% less tedious :D
The gui editor is trash
Try Arma Dialog Creator, it's best of what I've seen
yea, i quickly found that one out, i've been making things by just text for now, with a ton of
1 start scenario
2 see what it complains about
3 put that in (often guessing the type/class)
4 repeat
i generally steer away from wysiwyg editors but since you recommend it i'll check it out :)
In my practice, it lacks certain flexibility of plain config editing. I generally use it to place things initially. After that I do edits to the config manually, everything ADC could not handle. Then when I need to reposition stuff, I go back to ADC, reposition, export again, and copy-paste the positions.
Not ideal but... ๐คท
Better than BI's provided "Tool"*
||*Can barely classify that as a useful tool, probably Ok for a project for several weekends||
does it support pixelgrid?
aw, then it's kinda out for me, i like the pixelgrid too much
well... it can evaluate SQF expressions so it could be useful for preview with different GUI sizes
It renders stuff like in arma as I know
so i could basically paste the code in there and use it only as a quicker renderer? because that would actually be very useful
sort of yes, I am not sure if it supports all the commands
@weak jewel remember to try pixelgrid in several InterfaceSizes, Resolutions and AspectRatios. You will be suprised :/
i haven't run into any trouble with it yet, but yea, i keep testing it in different modes from time to time
I usually draw something out in paint, get it all in game and then break out the calculator. The movement translation is way too much in the editor.
I usually start out with quick drawings on post-its and eyeball the coords from that, and then tweak it in place after it's all in there
can someone please tell me whats wrong with this?
_display = findDisplay 46 createDisplay "RscDisplayEmpty";
_mouseArea = _display ctrlCreate ["RscText", 8000];
_mouseArea ctrlSetPosition [0,0,1,1];
_mouseArea ctrlSetBackgroundColor [0,0,0,0.5];
_mouseArea ctrlCommit 0;
_mouseEH = _mouseArea ctrlAddEventHandler["MouseButtonDown","hint str _this"];
how i can import this to gui editor?```
/* #Luduwo
$[
1.063,
["1234567890",[["0","0","1","1"],"0.025/2","0.04/2","GUI_GRID"],0,0,0],
[1103,"line_horizontal",[1,"",["-0.00328125 * safezoneW","0.1795 * safezoneH","1.00289 * safezoneW","0.0015 * safezoneH"],[-1,-1,-1,-1],[0.3,0.34,0.37,0.8],[-1,-1,-1,-1],"","-1"],[]],
[1105,"group_prices_main",[1,"",["-0.0721878 * safezoneW","-0.0165 * safezoneH","0.549141 * safezoneW","0.6435 * safezoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]],
[1106,"the_grup_right_infos",[1,"",["0.482109 * safezoneW","-0.0165 * safezoneH","0.216563 * safezoneW","0.6435 * safezoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]]
]
*/
@valid dirge is working for me
return ```
[Control #8000,0,0.261364,0.421329,false,false,false]
just change RscText to RscStructuredText
as i understand RscText is something like background control
Hello I need help, I am trying to improve the HUD of my mission but I am struggling, my goal is to have an image as background under rsctext dynamic, I am trying with Rscpicture but I am doing something wrong
- I don't know how to keep the aspect ratio
- I don't know how to put the image under the text at moment I changed idc or the definition order and still images is above the rsctext
- I dont know why crtlShow false hide the text but the image is always visible.
please help
- ok I've found how to keep aspect ratio
- I managed to hide/show using setText and controcommit
- I've managed to put under the text
- I need to know how to keep the real size+aspect ratio of the image now, cos yes aspect ratio is correct but the size is not the same I am trying random value but I really wish there is a way to make it without this huge frustrating struggling.
I did it but it's painful trying pixel by pixel, there is no way to keep size/aspect ratio of an image in GUI ?
You mean keeping the size (x,y) of an image?
yes if one imagine is 512x512 I want to have it 512x512
keepaspectratio don't stretch the image but don't make it the same size as original PAA
So 256x256
Just simply divide it
- you need to recalc to 4:3
So if you with is 256 (4), the height must be 256*0.75 (3)
(or the other way around, i always mix that)
are you expert with GUI would you like to save me some head banging on the wall
with this code:
class hudtopbar : RscPictureKeepAspect
{
idc=1201;
//style = 2096;
text = "";
colorText[] = {1,1,1,0.7};
x = 0.253892 * safezoneW + safezoneX;
y = 0.000 * safezoneH + safezoneY;
w = 0.485153 * safezoneW;
h = 0.495153 * safezoneH;
};
I got something close to the 512x512
so I guess it's the width that should be less than height
but
Play around with this:
x = 0 * (((getResolution select 4) min 1.2) / 40) + (safezoneX + (safezoneW - ((getResolution select 7) min 1.2))/2)
y = 0 * ((((getResolution select 4) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((getResolution select 7) min 1.2) / 1.2))/2)
w = 1 * (((getResolution select 4) min 1.2) / 40);
h = 1 * ((((getResolution select 4) min 1.2) / 1.2) / 25);```
For other examples: Check the unpacked UI_F Folder. There are some more informations.
- Those will be your friends too:
https://community.bistudio.com/wiki/SafeZone
https://community.bistudio.com/wiki/getResolution
as i said: Play around with the code i posted above.
Welcome to the world of UIs ๐
Not "that" hard (when you understood the basics), just timeconsuming af.
I am lucky I just miss 1 more image then the UI is complete
if you accept my friend request I show you the result
You know what's funny? change to WindowMode, change the resolution to a different AspectRatio (e.g. Resolution from 16:9 to 16:10) and InterfaceSize, restart your game.
Nah, off to bed in a sec.
I knwo I will not do that,
my gui will be for smallsize ui
I don't plan to do for all other sizes
I don't want to spend the precious time of this life doing that
I am super convinced that there could be a much simple and wysiwyg mode
year 2020
thanks for help
how to make a list/combo box with multi selection possible?
and how with that has three states (whitelisted, not selected, blacklisted)
@agile sinew search multi selection, you will see you have asked that some time ago already xD
kju09/18/2019
is there a multi selection combo box or similar, or do you have to piece it together yourself?
sorry bad wording
i meant you have a list - normally its just on, off/selected, not selected. yet i need three states
think of a list of game modes to black or whitelist them
or tick on/off or any. see: https://dev.arma3.com/assets/img/post/images/oprep_2_concept.jpg
BI uses here three buttons (difficulty)
are two lists (one for whitelist, another for blacklist)
Oh I get it I think. You can make your own advanced list box with a group and multiple rows of buttons then
Maybe you can do what you want with three listboxes if it will help get things more organized. So in the center listbox you have all items. 'Left arrow' button moves the item to the left listbox (blacklisted items), 'right arrow' button moves the item to the right listbox (whitelisted item)
@agile sinew so you want list of game types and be able to choose which type you prefer to play, which you don't mind to play and which you don't want to play? Then have a normal list box, then on 1 click change item color to green, on second click to red, on third click to neutral (while also setting data on the item). Then in the end iterate through all entries and read data and do your thing.
@weary imp thanks. such virtual state list using colors is what we probably end up with
you can also add to item description like
displayed: CTF
1st click - displayed green: CTF (Preferred)
2nd click - displayed red: CTF (Avoid)
3rd click - displayed neutral: CTF
or
use lbPicture and have empty box, box with a green tick, box with a red cross
true ๐
Is there any way of identifying what RscDisplays are currently visible?
Got one showing up and I'm having issues identifying it
Image: https://imgur.com/a/Ut28Azk
tried to output https://community.bistudio.com/wiki/User_Interface_Event_Handlers#onMouseHolding yet ?
Is there any way of identifying what RscDisplays are currently visible?
allDisplays
Is there a better action menu than the default one? In better I mean something that is more fluid rather having to remember numbers to get to say..."the radio menu without having to hit 0 twice?"
I guess what I'm asking for is there a replacement for the default action menu?
radial menu like in ACE or other standalone mods
I think he means not the layout of menu as GUI framework... but rather a complete solution which replaces the default command menu
The most I've used the ACE radial menu is when joining a squad in single player. I'm thinking more on the lines of what @ocean hazel stated
kind of like an all in one command menu, Didn't OFP have a radio command menu
for AI commanding there are a few "replacements"
Anyone around that time to make some ui's for a life server
You paying?
if they are good
Does anybody know of an GUI editor that just gives me coordinates?
I know about the Arma Dialog Creator Tool and I use it myself for quite some time now but cleaning the file it produces of everything except positions is very annoying...
Also it apparently does not support the pixel grid system which its quite sad since it makes more sense in my head then this weird safeZone stuff... (Id rather draw my UI on a piece of paper and just use calculator to get the anchor points but well... haven't found a formula to do that yet)
Like some way to convert "normal" coordinates from any WYSIWYG editor to ArmA 3 GUI cords would be nice
Well ADC is doing pretty fine.
I've also made a tool but it's less complete than ADC (although it's easier for me to "template" my GUI and changing manually value if needed) but it's better when you have predefined some base class: https://forums.bohemia.net/forums/topic/225459-adobe-xd-to-arma-3-convert-your-adobe-xd-guis-to-arma-3-sort-of/
For some way to convert from "normal" (Pixels) coordinates to safezones
/* CHANGE THOSE 2 BELOW IF YOU'RE DESIGNING YOUR GUIS IN ANOTHER SCREEN FORMAT */
#define ORIGINAL_SCREEN_WIDTH 1920
#define ORIGINAL_SCREEN_HEIGHT 1080
/* HORIZONTAL ADJUSTEMENT MACROS */
#define X_POS(X) (((X * (getResolution select 0)) / ORIGINAL_SCREEN_WIDTH) / (getResolution select 0))
#define X_FROM_LEFT(X,W,H) (X_POS(X) + WIDTH(W) - WIDTH_FROM_HEIGHT(W,H))
#define WIDTH(W) (((W * (getResolution select 0)) / ORIGINAL_SCREEN_WIDTH) / (getResolution select 0))
#define WIDTH_FROM_HEIGHT(W,H) (((W / H) * ((H / ORIGINAL_SCREEN_HEIGHT) * (getResolution select 1))) / (getResolution select 0))
/* VERTICAL ADJUSTEMENT MACROS */
#define Y_POS(Y) (((Y * (getResolution select 1)) / ORIGINAL_SCREEN_HEIGHT) / (getResolution select 1))
#define Y_FROM_BOTTOM(X,Y,W,H) (Y_POS(Y) + HEIGHT(H) - HEIGHT_FROM_WIDTH(W,H))
#define HEIGHT(H) (((H * (getResolution select 1)) / ORIGINAL_SCREEN_HEIGHT) / (getResolution select 1))
#define HEIGHT_FROM_WIDTH(W,H) ((H / W) * ((W / ORIGINAL_SCREEN_WIDTH) * (getResolution select 0))) / (getResolution select 1)
Why do you limit yourself to fixed sizes?
@barren apex Sounds like an interesting tool. Never heard of Adobe XD though. Will look into it.
Those macros also seem to be very helpful. Though if I convert normal pixels to safeZones, isn't that basically what the pixel grids already do?
ADC also works quite okayish for me but its a bit annoying to use if I really only need to see and set the positions of my controls and nothing else.
this is a more appropriate forum... Q: when you style = ST_RIGHT; on a textual UI resource, is that right aligned in the w of the resource? does that change the x component at all? i.e. your x is still "left of" the resource? or is the x then on the "right of" the resource?
It should align the text inside the box to the right of the box, there are left/center/right options like you would imagine it to work with text alignment anywhere
right I understand that much. but the actual x y coordinates are still the same?
just aligned within the w
x,y coordinates of what? Of the text inside?
Or of the box?
Style of a control does not alter the x,y,w,h of the control
of the resource.
do you mean 'resource' - the control (button, static, etc) ?
yes. so in other words, alignment styling just impacts within the w of the resource.
yes, style changed only appearence, does not change the position of the control
awesome that's what I needed to know. cheers.
I assume you thought that, perhaps, arma can snap a button to the right of its parent control, for instance. No, arma does not have such layout capabilities.
ctrlGroup
It's not what I meant
I meant like in some advanced layout UIs you can snap things to each other
Like, where you have a proper editor?
That doesn't exist, stop lying!!!!111
Not at Bohemia, no ๐
๐
Well, not for us at least...
here's a question, how do you control tab order?
@ocean hazel the closest thing to a "layout" manager I have come by in A3 is to define your geometry up front, and interrelate as desired. so if I make an adjustment to resource A, the same adjustment is theoretically had by B without needing to touch a thing. then sprinkle those definitions in throughout the classes as needed.
however, for a layout manager, panels, stacks, etc, would be nice.
certainly would recommend against intense formulas in the resource definitions. far too brittle to layout changes.
What do you mean 'tab order'?
Yes you can do a similar thing as you describe )with formulas) through script too, for instance I have made a 'window' (like in windows) which has the top bar, close button, and similar things, which resizes to its payload
Tab order, literally what it sounds like. When you tab through a dialog, in what order the controls receive their focus.
This is like UI design 101, really.
I'm not positive, is that the controls[] = {} array?
Yes, Controls are added in order by that array no matter the order or idc you define in the classes
Added in that order? Or "tab order"?
Better check yourself. I think they will de added in that order, and you will tab through them in that order as well. IDC should not be relevant to the tab order.
I thought you meant like how to make some multi tab thing
Yes, Controls are added in order by that array no matter the order or idc you define in the classes
Letโs straighten this up before someone gets confused. controls[] only valid if there is no class Controls, then the order of controls is taken from this array, if there is class Controls then controls[] is ignored and the order is the same as the order in which controls appear inside class Controls
Same for objects
hi there a way to learn how to customize ui? like tutorial or somethin?
how to customize it like the hud and stuff I not sure how to explain but like let say health bar if I wanted to reposition and redesign it
There is no health bar in Arma 3
He's probably talking about the life healthcare or whatever. You can look KK's tutorials on GUI, it will give you a good basis.
The XML framework is there @ocean hazel
Only my time is not
hello , i wanna make gui script ,mm.. ex: it can restart just user self by voting , so i wanna made this โโโโ please help me !!
mm i want to make in my server users can vote the restart also 50%up yes 50%down no
i want to make please help
Voting is part of the engine, you can set it up on the server now
@weary imp No... i want just some text pop out to everyone
that is my ques..
...
๐
Hey guys I want to modify e Arma GUI with an mod (add a button) but when I over write the Config name nothing happen. The GUI I want to modify is RscDisplayDynamicGroups. Is there some thing that I have to consider or add?
@ember gulch pastebin your config
Q: when dealing with sizeEx, what is considered a 1, that is, base, nominal, default, whatever, sizeEx value? For frame of reference, in terms of the A3 displays GUI_GRID_X et al definitions.
in other words, I want to make it smaller, let's say, by some nominal, predictable dimension, i.e. 0.5 * GUI_GRID_X ?
sizeEx = 0.04 * safezoneW for example
So sizeEx = num * GUI_GRID_W is probably the line you are looking for.
Yet, i wouldn't use the grid-stuff, since it changes with the resolution and could end up in borked up interfaces on different Resolutions/Interfacesizes
I think I got it sorted. So we go with something like (0.75 * GUI_GRID_CENTER_H) for our common H dimension. Then something like (0.85 * KPLIB_COMMON_GRID_BASE_H) for a sensible "small" dimension. For starters. And adjust from there, larger or smaller, accordingly.
@placid osprey Meh, I disagree. That's the point of using those definitions. You tame the resolution beast and arrest it in one place.
in fact I build on that through a couple of layers of definitions in order to isolate the "layout" aspect in one place.
"a couple of layers"
vs
0.1 * safezoneW + safezoneX to keep it in one place/size.
But sure, do what you think is the best for you. I won't stop ya. Just remember to test it in several Resolutions, Aspect Ratios and InterfaceSizes.
@placid osprey Sure. Rinse and repeat that a dozen times and come back to me with the story of how brittle that is to responding to overall "layout" changes.
Dude, what is your problem?
sizeEx 1 should make letter as big as height of viewport
@agile sinew https://pastebin.com/SZFbrWVA
@ember gulch where is your cfgPatches header?
Can anyone show me or link a simple small script interactable menu that I can use to learn from. Iโm not sure how to actually go about this.
Can be as simple as a background with 1 button lol. Anything is appreciated
Hope this is not too much to ask^
Check the examples
Also:
https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3
ctrl+F -> type "ctrl" -> F3 == Your friend forever
Working on the pilotview for my aircraft.
What controls the marked points showing? https://gyazo.com/68baaae9614b4883cc15d8d87be86b77
Ive tried changing unitInfoType = "RscOptics_CAS_Pilot"; //rsc with DriverOptics elements driverWeaponsInfoType = "RscOptics_CAS_01_TGP"; //resource with Weapon UI elements that will be used when looking through the pilotCamera with 0 results.
How would I go about making a mini-map GUI that doesnโt pause input
RscTitles
"somethingsomething" cutRsc ["yourMinimapClass", "PLAIN"] ezpz
put your UI class within RscTitles
Someone here asked before for a simple GUI example to start with. https://community.bistudio.com/wiki/ctrlCreate Example 5, knock yourself out
hello, is it possible to add a picture to a button, literally is of type "button", that is, 0x1.
Do mouseEnter/exit, buttonDown event handlers work with static controls?
Hello, HNY for those where it is. Need to know, for an edit/input text box, is there an event that indicates "text changed"?
i think so yeah
hmm, well, I am reviewing, I do not see one? https://community.bistudio.com/wiki/User_Interface_Event_Handlers
I see for things like LB or LNB selections changed, that sort of thing.
I suppose I could watch for onKeyUp for the characters of interest and monitor that way?
for that, basically. on the event, evaluate some other controls, enable/disable buttons, etc, in response.
Oh okey, there's also this event: https://community.bistudio.com/wiki/User_Interface_Event_Handlers#onChar which only detect characters
and are those ASCII _charCode?
I think the code are these one: https://community.bistudio.com/wiki/DIK_KeyCodes
perfect, thanks.
versus, I suppose, onIMEChar. does this happen in what relation to the text in the control having updated?
I don't understand your question, can you rephrase it?
what is the timing of onChar? i.e. before/during/after the control text having changed?
[Key Press]-->[Control Update]-->[Event]-->[Key Release] seems to be the logical order to me
Yeah, I'm almost pretty sure that's the order I've sent, I was able to get the update text from the event callback
perfect, works pretty well. now... if I wanted to constrain the key entry for a digits only? plus navigation keys, like TAB, etc... then I use key press? or key down? and respond with handled?
Yep, keyDown
If I use the Arma 3 UI editor, how should I define the parent classes for the controls like:
...
};```
I know I can export the base classes from the editor. but should I include them for each dialog I create?
Or is there a smarter way?
include it once before your dialogs, not once per dialog don't get me wrong.
hey, would anyone like to help me out on why the sidearrows for RscListNBox are not showing?
here is my dialog
https://pastebin.com/uQ4haTYw
and here are my defines:
everything else appears fine, but not the side-arrows
the dialog is nested in
class sah_inventory_dialog
{
idd = 1999;
movingEnabled = false;
class controls
{
//////HERE!!!///////
};
};```
been there, tried that. It must be something i'm not getting
drawSideArrows is true and idcLeft/Right have valid idc's
what is the practical difference between listnbox and listbox?
because as you can see, i have drawSideArrows true but it wont draw any arrows
it DOES reserve the space for the arrows
but it wont draw them
neither does interacting with the reserved space yeild any actions on the idc's
by this point, im willing to make a donation if somebody manages to make these arrows draw
ask for any code, it's an unlicensed project anyways
listNBox is multcolumn
listbox is single
In general unless you're trying to do very basic stuff, a scripted setup with control groups is almost always better
there's a lot of inconsistencies and limitations with those listboxes that might start giving issues. One i always ran into was the lack of being able to set the size of pictures
the pictures are perfect size for what im going for
couldn't have been better
some things i want to know
you see what im going for
and im struggling to get the side-arrows to appear
slowly but surely
dat A2 feeling
now if i just got these pesky side-arrows working
no no, these side ones that are supposed to be draw next to the selection
really scratching my head on this one
to the right and the left, so i can use them for inventory interactions
uhm, mark it pls. I have no idea wich ones you mean
can't get to the website right now
is down
@placid osprey can i DM you?
jsut the pictures, i cant send anything here
https://web.archive.org/ helps when wiki is (regularly) down
ah, nice
So I'm trying to make a toolbox and it is not representing the strings at all. here is the class:
class tb_vehicleClass: RscToolbox
{
idc = 1800;
//style = 2098;
style = 2;
x = 0.25601 * safezoneW + safezoneX;
y = 0.71 * safezoneH + safezoneY;
w = 0.179782 * safezoneW;
h = 0.084 * safezoneH;
colorText[] = {0, 1, 0, 1};
colorTextSelect[] = {1, 0, 0, 1};
colorBackground[] = {0, 0, 1, 0.3};
colorSelectedBg[] = {0, 0, 0, 0.2};
rows = 2;
columns = 3;
//strings[] = {"res\LightVicApp.paa", "res\HeavyApp.paa", "res\BoatApp.paa", "res\SupportApp.paa", "res\HeliApp.paa", "res\PlaneApp.paa"};
strings[] = {"Light", "Heavy", "Naval", "Support", "Helo", "Fixedwing"};
checked_strings[] = {"[Light]", "[Heavy]", "[Naval]", "[Support]", "[Helo]", "[Fixedwing]"};
};```
any idea why i am having an issue?
All I am getting is a toolbox without any strings on the buttons. Just the buttons themselves
Ignore above, i fixed it
Is it maybe a known thing that main display event handlers get removed?
(finddisplay 46) displayAddEventHandler ["KeyDown", {
For some reason it starts to fail after several hours randomly
Or what is a safer way to check key presses... maybe cba has that, need to check
I assume some script removes it (by ID)
https://community.bistudio.com/wiki/displayRemoveAllEventHandlers
https://community.bistudio.com/wiki/displayRemoveEventHandler
That would be a shame but that's the only way I know
tried inputAction yet?
maybe cba has that
CBA uses keydown on the display. like you do
Thanks @agile sinew I will try an on each frame handler with inputAction instead
@ocean hazel you can combine also keyDown with inputAction
Oh wait, inputAction accepts arma actions, not raw keys...
raw keys is usually a bad idea due to ppl customized controls
Yeah, using raw key is a bad idea, better stay with Arma Custom actions/CBA Keyhandler or write your own if you want more support than the CBA one offers (although I don't see much missing from the CBA one)
Will look into cba, thanks
Btw... can't check now... which display is the virtual arsenal? Also 46?
ehm, lemme check, i got one open currently
Hm, as marked on the page "working with type=102 (CT_LISTNBOX=102)" -> Nope, i can see no diff here
Maybe A2 only 
probably.
i tested
LineSpacing = 2.0;
LineSpacing = 1.0;
LineSpacing = 0.1;
No difference
@quiet arrow
rowHeight = int;
is the one, that should be used for that.
Oh I missed that. Gone test that ty
Hello There! By any chance anyone knows the path (IDD/IDC) to the hint text?
uff, erm... wait a sec. I just remember that it was a structuredText
class RscHintGroup: RscControlsGroupNoScrollbars
{
idc = 12957;
class controls
{
class Title: RscStructuredText
{
idc = 11657;
...
class Hint: RscStructuredText
{
idc = 11757;
...
I think it was this @fluid oracle
*
yeah, found it. I assume it should be in #46 display? Does not seem to work though.
I have also found IGUI #301, could not find it
It's in
class RscTitles So without the name set in the ui namespace ยฏ_(ใ)_/ยฏ
tbh, what I really want to do is a handy custom hint function which makes the hint text appear only for a given time (in seconds), but for that I would need to check if the actual hint text changed
oh
RscAdvancedHint is also in RscTitles :/
wait a sec
class RscDisplayCommonHint: RscDisplayCommon
{
name = "Common";
onload = "uinamespace setvariable ['Hsim_RscDisplayCommonHint',_this select 0];";
onunload = "uinamespace setvariable ['Hsim_RscDisplayCommonHint',nil];";
class HintGroup: RscControlsGroup
{
idc = 2300;
class controls
{
class HintText: RscStructuredText
{
idc = 1100;
god... how many hint's are there?...
that's why I asked, it is pretty difficult to find the actual one. The last one does not seem to work either ๐
nothing set for Hsim_RscDisplayCommonHint
which is hintC , not the regular hint ๐ฆ
is there a way to set the Z order of controls? I have "shadow" controls I want to be in the background. basically icons with shadow icons. Or better yet style the image itself with its own shadow? Thanks...
Changing it - don't remember, but it depends on the order of control creation, which gets created first.
If you are creating them from config, try to swap their order there
ctrlSetFocus works as well in some cases to change order
But whenever you interact with a button, it'll get pulled forwarded either way
yes I don't need to change the Z order, just want to ensure that controls are forward that ought to be forward, etc. I'll try arranging their def order. thanks.
yep, order in the controls array is the key. controls appearing later in the array have a more forward Z order; that is before events, etc, get ahold of anything, but for static images, shadow images, etc, that's the key.
anyone got these to work/knows what these are about?
or are these also old 2d editor commands
I would have expected it to be a getter for menuSetAction / the corresponding action config value - i.e. for the new CT_MENU_STRIP controls
but it's not working for me, the return value is always an empty string - even so the action set with menuSetAction works just fine
or are these also old 2d editor commands
added in A3 1.56? no, certainly not
p:\a3\3den\functions\fn_3deninterface.sqf
273 private _shortcutText = _ctrlMenuBar menushortcuttext _path;
275 _shortcuts pushback tolower (_ctrlMenuBar menudata _path);
thats the only use by BI it seems
(of the whole command family)
thats the combo/titlebar menu
can someone think of ways to interact with the native AI command menu?
there is https://community.bistudio.com/wiki/showCommandingMenu but couldnt find any way to interact with it
@agile sinew I might try to get a menustrip control to work and post some example. Just need to find some time
ty
kind of a UI thing I think, trying to create some icons for use with ACE menus... I have the base PNG image ready, has a transparent background, saving from Windows paint.net as auto-detect.
I drag it into TexView2 and initially opens as RGBA+ARGB8888. I try to save as RGBA+DXT5 but it flips to ARGB4444.
Then in game the icon is appearing black instead of the color I chose.
any tips to ensure the correct pallete is being used?
and actually now instead of appearing black, the icon is kind of smudgy looking. I am trying to achieve the solid colors, or at least white, if possible.
make sure its power of 2 resolution
resolution? or size? i.e. 32?
@opaque lynx if you have a lot of icons, i recommend ImageToPAA in the arma 3 tools, as it can batch-convert png to paa
Q, the icon converted, more or less. I had it solid color like I wanted it once, but I'm not sure how I managed that. now the icon mask seems correct, but it is showing kind of smudgy. is it picking a pixel and using that as the color?
hmm, maybe Arma is caching the images...
seems like Arma is caching the images. when I name it one that it was, appears like it was. when I rename it to a new name, it is correct.
arma 3 indeed caches images
just rename it to "image_pp_Xx_v1" or something
and then keep going
Use correct texture suffixes too
Anyone know of some way to change cursor for a dialog?
It's profilenamespace getvariable "GUI_BCG_RGB_(R/G/B)"
listbox background and iguiback colors
I think the default colorbackground is pure black with some alpha; look at the file the dialog you sent is from
@restive girder Can't think of one (scripted way) :/
If you find a way -> Hit me up, i would also be interested in it
@restive girder @placid osprey Maybe not the best way but:
class CfgPatches {
class Cursorless {
name = "Cursorless";
author = "Echo (Heyoxe)";
url = "https://github.com/Heyoxe/A3-Cursorless";
requiredAddons[] = {};
requiredVersion = 1.96;
units[] = {};
weapons[] = {};
version = 0.1;
};
};
class CfgWrapperUI {
class Cursors {
class Arrow {
texture = "\A3\ui_f\data\gui\cfg\cursors\arrow_gs.paa";
width = 1;
height = 1;
hotspotX = 0.1875;
hotspotY = 0.03125;
color[] = { 1, 1, 1, "uiNamespace getVariable [""#CursorAlpha"", 1];"};
};
};
};
Then run uiNamespace setVariable ["#CursorAlpha", 0.002]; to hide the cursor or uiNamespace setVariable ["#CursorAlpha", 1]; to show it.
You cannot get the alpha <= 0.001 otherwise it shows it again
Oh yea that should work like that, thanks a lot ๐
hmmmmm
@placid osprey
@restive girder ๐ hi
Is there a way to change the height of a line in a multi line edit box?
lineSpacing = 1; maybe?
nope
No. This was related to list boxes not CT_EDIT
Hello GUI Cracks! Some of you might know the Timeline from Laws of War. Is it made with custom coding or are there functions for it inside of the game? I just need to know if it's a part of the game or if I have to learn gui coding as well.
I simply loved that feature
You mean the bar at the top of the screen which is used to show the current time (past, present) during flashbacks? @tepid pier
@quiet arrow yes it's Hella chic but I did not find the right code in the mission :(
As my campaign will mostly be playing before the intro mission it would be a nice feature
@tepid pier Did you unpack the mission pbos ?
Yep but I hoped there is a ready to go function in base game.
I don't know any.
Ah ffs, took another look at the mission, seems to be two custom textures and a lot of coding
Could probably recreate it but there is a ton of coding integrated, have to filter out the animation part
Hello, is possible to make control with rounded borders?
as i remember in arma 2 was existing style to make this
Yep, but in Arma 3 it can only be set across the whole game and by config iirc
Style 128
Hello GUI makers, some time after respawn the alignment of guy get bugged text that should be on top of image goes on bottom, and you need to relog to fix that, it's possible to "reset" a gui in order to have proper layer order without logout?, or it's possible to prevent that to happen?
Close and reopen the gui should work, but tbh I don't see how alignment can be messed up after a respawn. Gui coordinates are mostly static and unless you use sqf, controls shouldn't move
I think he is talking about the Z coordinate
As in a frame being rendered atop another
In which cas ei would recommend putting all your stuff in a background or frame
But as Heyoxe said
Oh, well that shouldn't change either unless the user clicks on a control that was behind and was not disabled
Closing and reopening should fix it
Does anyone know how the multiselection listnBox works? It seems to only return a number on onLBSelChanged where I would expect it to return an array with all selected rows.
onLBSelChanged only returns the index of the curSel, not the selection - to get the later one you have to use lbSelection
listNBoxes have both, a curSel and a selection
Oh I see
in listNBoxes:
curSelis the latest navigated/selected/dselected row - e.g. when using [Ctrl]+[LMB] to select/deselect multiple rows then the last clicked one is the currentcurSel
so when pressing [Ctrl] and clicking row 5, 6, 7, 5 of a listNBox thencurSelwill be5but theselectionwill be[6, 7]- Arma will make sure that the
curSelrow is visible - i.e.lbSetCurSelcan be used to scroll the listNBox
Alright. Thanks for the info. Gonna test that when I am at home.
and both curSel and selection are visually marked in different ways
the selectionrows are solid white
while the curSel row has a thin black border
so a single row can have both, too
at least that are the colors for me, I would expect that it is (at least partly) configurable
I think they are.
Hi all how would I make a dialog where itโs like a wiki. Basically it will tell you what to do and how to do it. So on my Altis life server thereโs a fed so on the wiki menu it will say what u need to rob the fed and how to do it. Is that even possible?
So it would say Federal Reserver then a drop down menu would say what u have to do and all that
@grave dust Like the field manual?
@quiet arrow What does the field manual? In fact lemme just look it up real quick
YES WHERE CAN I GET THIS DIALOG
Thatโs nice
Oh nice @quasi granite I forgot this was customizeable
Ups, it's advanced hints
Yeah that would work for him too I guess.
apparently advanced hints will also be added to the field manual
Hi all, i hope this is the right place but any idea why this is happening with my RscCombo ? https://imgur.com/a/5A4A4mH
looks like there is some input given elsewhere deselecting the combo. maybe some looped ctrlSetFocus? or a mousebuttondown uieh that intercepts the input.
Combo boxes are bugged as hell. I just found out today that when you set a right picture to them, you can't click on that to select the entry. It will always select the control behind that. Very weird.
If you have space in your UI use a list box.
I want to add custom indicator to vehicle crew. Tried to add my custom control to RscUnitInfo, but looks like game ignores it (onLoad code is not executed).
So what should i do to make my indicator work? Add onLoad code to some default vehicle control (speed/alt/damage indicators) and create control manually?
pastebin your complete config
uiNamespace getVariable "BloodVolumeInfo" returns control (in and out of vehicle)
uiNamespace getVariable "CrewBloodVolumeInfo" returns nil (in and out of vehicle)
class CfgPatches
{
class x_Medical
{
units[] = {};
weapons[] = {};
requiredVersion = 0.1;
requiredAddons[] = {
"A3_Data_F_Enoch_Loadorder",
"A3_Data_F_Mod_Loadorder",
"CBA_MAIN",
"ace_medical",
"ace_medical_feedback",
"ace_medical_treatment"
};
version = "v3"
};
};```
> RscUnitInfoSoldier for infantry
For infantry all works with how it's now, problem when you play as crew (driver/gunner) of vehicle.
vehicles have their own class
tried to move my controls to RscUnitVehicle but it didn't work.
Maybe adding my control to controls[] property for every child of RscUnitInfo is solution, but there are 63 classes ๐ฃ
you need to check inheritance and what defines controls itself
however most of those 63 should be irrelevant to your purpose
Things are not getting easy ๐
Anyway thanks for help!
use config dump
and regex to clear the definitions
delete all but: ^(?!.*?(^ *class|controls)).*\r\n
Would anyone know why this is happening?
https://gyazo.com/b28d0b1f0c14fc75fd4f890172439e61
The image is there but it is like opacity is like 5%. any ideas?
Yeah the background
Actual image
Probably not in a (2^n)x(2^n) format (1024x1024, 512x1024, ...)
Or a script that changes the fading/alpha of the image ยฏ_(ใ)_/ยฏ
it is the first thing roughly 100% of the time that happens
the fix is rather simple: use the image program of your choice, upscale it to the next 2^nยฒ and then downscale ingame by stretching it according to your likings
Am I missing something or is that image just a black picture?
@barren apex i tried your xd2a3 exporter just now , set the .svg file path etc, but when i click on download (https://xd2a3.heyoxe.ch/exporter) nothing happens. Any idea what could be amiss?
There is no error on screen @storm loom ?
@barren apex No error appears
Doesn't seem to work quite well for me either, and errors aren't even working at all, do you mind sending me the SVG file in DM, I'll take a quick look
will do
class Title : RscTitle {
//idc = 832406;
text = "TMF Loadout Jukebox";
x = 0.404852 * safezoneW + safezoneX;
y = 0.432309 * safezoneH + safezoneY;
w = 0.190295 * safezoneW;
h = SIZE_S * GRID_H;
sizeEx = SIZEEX_PURISTA(SIZEEX_S);
};
Need some help here, adding the sizeEx property makes the text go invisible
Previously it was (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1) which when run in debug console equals 0.04
are those macros defined?
Yeah
what number does the config viewer display?
hmmm
That should work then.
What happens if you just put 0.03 in there, without any macros?
On another note, why are you using safezone for positioning put pixelgrid for text size? That might cause issues, or at least some weird looking UI for some aspect ratios
I'm switching over to pixelgrid from safezone
I see. Good choice
I was looking at the wrong class, it says sizeEx = "any" instead
Then it's the macros which is not available
Make sure to include #include "\a3\3DEN\UI\macros.inc"
It is included as the other macros work
That one isn't
That's doing the calculations for SIZEEX
That would be it then
SIZEEX_PURISTA is a dynamic macro. The text size gets calculated by "macrosexecs"
Yeah I was wondering where _fnc_sizeEx came from
Now you know
Is there a wiki page for it?
loadFile "\a3\3DEN\UI\macroexecs.inc"``` in the debug console
and copy the stuff in your text editor
There is no wiki page about it.
Better than any I suppose ๐
That shouldn't matter.
It should at least return str _sizeEx + "" * "" + _pixelH + "" * pixelGrid * "" + str pixelScale\ but never an empty string.
Well I switched it around and now it works๐ค
sizeEx = "3.96 * (1 / (getResolution select 3)) * pixelGrid * 0.5";
So the order does matter.
Yeah, it does, my bad.
#include "\a3\3DEN\UI\macroexecs.inc"```That's my order.
Feels like there needs to be a wikipage for this stuff
for preprocessor commands there is
Yeah but for the UI macros
Well, they are not that hard to understand and now you know you can look at them with loadFile
The difficult part is finding out that they actually exist
I was playing around with the old grid system for an hour before stumbling upon it
https://community.bistudio.com/wiki/Arma_3_Pixel_Grid_System I added them to the pixel grid system
Add that they need to be in that order ๐
why use pixel grid system over safezone, or maybe when to use each?
pixelgrid is better because you dont get artifacts which might happen with safezone values when the engine rounds up or down for not precise values bc you cant have "half of a pixel"
@agile sinew
problem now is that only the 3den editor uses the pixelgrid system so when creating guis on or modifying existing displays you'll have to use the same grid systems as the original display. Other problem is that when you are using baseclasses you'll have to pay attention to adjusting the attributes which contain grid values such as sizeEx or rowHeight.
Does this look good from a best practices perspective?
https://pastebin.com/BkmuStrR
Maybe use macros for the IDD/IDCs so it's easier to get them in with scripts if needed
Sounds like a good idea
@agile sinew [...]The problem here is that this number is not in pixels, it's in a percentage. This means the control could be drawn in between two pixels on the screen, which means the engine needs to then "guess" which pixel it should draw it in; often being not what the designer wanted. This leads to strange offsets across all controls on the screen, that can lead to crooked positioning, blurry text, perceived artefacts, and generally results in an unprofessional portrayal of the game and visual experience.[...] Source: https://community.bistudio.com/wiki/Arma_3_Pixel_Grid_System
so visual perfection vs complexity?
It's not really complex
You just turn the % from safeZoneW/H into actual pixel count.
In reality, the % is barely visible/noticable.
- pixelGrid-stuff resized with resolution, so it's kinda annoying.
So: There is a reason to use both of them, depending on the case.
e.g.:
Overlay with fixed Positions: safeZone
Menu: Can be done with pixelGrid and SZ
You cant define x and y positions with pixelGrid only so safezone still has its use
In reality, the % is barely visible/noticable.
And it's not that common, most users are not affected by that, most if the time it's those who use strange Aspect Ratios screens that are (so not 16:9 or 21:9)
@placid osprey You can use pixelGridNoUiScale for that.
UIScale != Resolution
iirc noUiScale just took InterfaceSize in count
@quiet arrow
Sorry I misread