Apparently, There is no known way to perform text alignments.
The Solution
Fortunately, a workaround was found to creating center aligned Dialog Labels. (Which isn't actually a dialog label)
The workaround is presented below in series of simple steps. This is done in both GUI and Galaxy.
In GUI
In Galaxy
voidinitCAD(){//Variablesintd;//Dialogplayergroupg=PlayerGroupAll();//Actions//1)CreateandShowDialogDialogCreate(600,150,c_anchorCenter,0,-150,true);d=DialogLastCreated();DialogSetVisible(d,g,true);//2)CreateDialogButton,SetSize/Position,ApplyTransparentBorderDialogControlCreate(d,c_triggerControlTypeButton);d=DialogControlLastCreated();DialogControlSetSize(d,g,550,100);DialogControlSetPosition(d,g,c_anchorTop,0,25);DialogControlSetPropertyAsString(d,c_triggerControlPropertyImage,g,"Assets\\Textures\\ui_callout_border_terran.dds");DialogControlSetPropertyAsString(d,c_triggerControlPropertyHoverImage,g,"Assets\\Textures\\ui_callout_border_terran.dds");//3)SettheDialogButtonstext,whichwillautoCenter.libNtve_gf_SetDialogItemText(DialogControlLastCreated(),StringToText("This uses Galaxy<n/>This time we enable it, but apply a dummy dialog over it to prevent user clicks"),g);//4)OptionalStep.//Tomakesureuserscannotclickthebutton,//Wecoveritupwithadummydialogbuttonwiththesamesizeandposition.//Thedummydialogbuttonistransparentandcannotbeclicked.DialogControlCreate(DialogLastCreated(),c_triggerControlTypeButton);d=DialogControlLastCreated();DialogControlSetSize(d,g,550,100);DialogControlSetPosition(d,g,c_anchorTop,0,20);DialogControlFadeTransparency(d,g,0.0,100.0);DialogControlSetEnabled(d,g,false);}
"Assets\Textures\ui_callout_border_terran.dds" is a critical element for this to work, as it is entirely transparent. Unfortunately, It can only be found if the Liberty Campaign Dependency is enabled. To activate this dependency, Simply go to File > Dependencies > Add Standard, Then enable it.
The finishing result can be seen in the screenshot below. If you wish to download the tutorial code, It has also been attached. Done~ Feel free to post any questions :)
The Problem:
Apparently, There is no known way to perform text alignments.
The Solution
Fortunately, a workaround was found to creating center aligned Dialog Labels. (Which isn't actually a dialog label)
The workaround is presented below in series of simple steps. This is done in both GUI and Galaxy.
In GUI
In Galaxy
"Assets\Textures\ui_callout_border_terran.dds" is a critical element for this to work, as it is entirely transparent. Unfortunately, It can only be found if the Liberty Campaign Dependency is enabled. To activate this dependency, Simply go to File > Dependencies > Add Standard, Then enable it.
The finishing result can be seen in the screenshot below. If you wish to download the tutorial code, It has also been attached. Done~ Feel free to post any questions :)
Update: Tutorial is complete, Feel free to post any questions or feedback if anything is not clear :)
Ye, thought about this myself, but had the problem with the clickable button. Nice trick with the disabled dummy button, did not come to my mind.
No chance for right alignment, I guess? ;)
@Kueken531: Go
Thanks, Glad to share it :) Unfortunately, No chance for right alignment D:
why not export and import the dds into your map instead of depencies
Because campaign dependencies do not increase filesize and are used by most maps anyway.
Sorry for the necro, just wanted to point out that this solution is obsolete, Tolkfan has a better one that can be found here
Locking this post.