Jump to content
HazJ

Vertical align RscStructuredText (using as title bar)

Recommended Posts

Hello,

Looking for a way to correctly align the text when using RscStructuredText control type.

The valign doesn't seem to have any effect.

Using invisible gap as explained on Wiki doesn't work too well - isn't a reliable solution.

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

Quote

To center text vertically, add extra line above with blank space ( ) and set its size to adjust:

k30LqTd.jpg

Any ideas?

		class title : RscStructuredText
		{
			idc = IDC_MS_TITLE;
			x = 0.25 * safezoneW + safezoneX;
			y = 0.16 * safezoneH + safezoneY;
			w = 0.5 * safezoneW;
			h = 0.03503 * safezoneH;
			colorText[] = {1, 1, 1, 1};
			colorBackground[] = TITLE_BACKGROUND_COLOUR;
		};
_title = _display displayCtrl IDC_MS_TITLE;
_title ctrlSetStructuredText parseText format ["<t align='left' size='1.25'>Mission Status</t> <t align='right' size='1.25'><img image='%1'/> %2<t align='right' size='0.75'>  (%3)</t>    </t>", _icon, name player, vehicleVarName player];

 

  • Like 1

Share this post


Link to post
Share on other sites

align how? I have used <t align='center'>Text</t> and it works good... I see you use it too but i'm not sure what is the problem?

Share this post


Link to post
Share on other sites

Look at the screenshot? Is is right there. I also explained it. It is not vertically aligned in the title bar.

Share this post


Link to post
Share on other sites
35 minutes ago, HazJ said:

It is not vertically aligned in the title bar.

 

well align='left' should be align='center' but you probably knew that already

Share this post


Link to post
Share on other sites

No. Please READ the question? VERTICALLY align. The text should be in the middle of the bar not at the top. Look at the pic below. Not 100% perfect but you get the idea.

p3wxxkM.jpg

Share this post


Link to post
Share on other sites

sorry little slow here :) I don't know if it's possible what you are asking but maybe you can just move the control down a bit? And did you remember to use ctrlCommit? That's all I can think of now

Share this post


Link to post
Share on other sites

lol... Thanks for trying.

Share this post


Link to post
Share on other sites

Bump! Anyone?

Share this post


Link to post
Share on other sites

Still need hellp with this. It is really annoying issue. I can't use RscTitle as it doesn't have structured text.

  • Like 1

Share this post


Link to post
Share on other sites
On 12/29/2018 at 12:24 PM, HazJ said:

Still need hellp with this. It is really annoying issue. I can't use RscTitle as it doesn't have structured text.

 

Hey HazJ, i just came across this post so not sure if your still wondering but its really quite easy to vertically align text by placing a blank line before the text your displaying and setting the size which will determine how far it will push the next line of text down.

As per example 2 https://community.bistudio.com/wiki/ctrlSetStructuredText

 

So in your case adding <t size='0.5'>&#160;</t><br/> to the front of your text string.
Adjust size='0.5' to make your text go up or down.

 

_title = _display displayCtrl IDC_MS_TITLE;
_title ctrlSetStructuredText parseText format ["<t size='0.5'>&#160;</t><br/><t align='left' size='1.25'>Mission Status</t> <t align='right' size='1.25'><img image='%1'/> %2<t align='right' size='0.75'>  (%3)</t>    </t>", _icon, name player, vehicleVarName player];

 

  • Like 1

Share this post


Link to post
Share on other sites

I am aware but if you read my question properly, you would of saw:

Quote

The valign doesn't seem to have any effect.

Using invisible gap as explained on Wiki doesn't work too well - isn't a reliable solution.

Adjusting the size to a lot larger value works but I don't really want the title bar text that big. You really think I don't read the Wiki? I even posted it in my first post. I even mentioned the gap which is (&#160;) as shown on the Wiki. I don't want to manually adjust it, I want an automatic solution not manual which is dependant on size='' and h value. All you've done is took a quick look at the Wiki and pasted a slightly modified edit. I am not having a go, I'm just saying, I did explain that in the first place. RscTitle doesn't have this problem for some reason but doesn't support structured text.

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

 

Btw, welcome to the forums.

Share this post


Link to post
Share on other sites

Maybe by using this style:

style = ST_MULTI;

(not sure, untested)

Share this post


Link to post
Share on other sites
18 minutes ago, Mr H. said:

Maybe by using this style:

style = ST_MULTI;

(not sure, untested)

Good thought but no dice. That actually hides the whole thing lol.

Share this post


Link to post
Share on other sites
On 12/29/2018 at 12:24 PM, HazJ said:

Still need hellp with this. It is really annoying issue. I can't use RscTitle as it doesn't have structured text.

 

Hey HazJ, i just came across this post so not sure if your still wondering but its really quite easy to vertically align text by placing a blank line before the text your displaying and setting the size which will determine how far it will push the next line of text down.

As per example 2 https://community.bistudio.com/wiki/ctrlSetStructuredText

 

So in your case adding <t size='0.5'>&#160;</t><br/> to the front of your text string.
Adjust size='0.5' to make your text go up or down.

 

_title = _display displayCtrl IDC_MS_TITLE;
_title ctrlSetStructuredText parseText format ["<t size='0.5'>&#160;</t><br/><t align='left' size='1.25'>Mission Status</t> <t align='right' size='1.25'><img image='%1'/> %2<t align='right' size='0.75'>  (%3)</t>    </t>", _icon, name player, vehicleVarName player];

yeh sorry i didn't read that but its what works or just setting the position of your control to where you want it to sit as valign is said to be obsolete according to https://community.bistudio.com/wiki/Dialog_Control#CONTROL_STYLES
Edit: Thats relating to drawing vertical text but there is a note... In addition, ST_UP, ST_DOWN, ST_VCENTER are stand alone styles and should not be mixed with any other styles
funny thing though is valign works like below it will set the position of text on a line of its own only when using more than 1 line of text
hint parseText "<t size='3'><t size='1' valign='top' align='right'>Top Right</t> <t size='1' valign='middle' align='center'>Middle Center</t> <t size='1' valign='bottom' align='left'>Bottom Left</t></t>";

  • Confused 1

Share this post


Link to post
Share on other sites

Again, I know. I wasn't asking about hint command. You seem to think I'm some scripting newbie. Or at least that is how you come across with your posts. I am pretty familiar with the Wiki. Maybe some other scripters can shed some light on the matter?

@Larrow

@Dedmen

@Grumpy Old Man

First three names that came to mind lol.

 

Share this post


Link to post
Share on other sites

2514 posts Joined: November 30, 2011 ......of course i dont think your a newbie

im pointing out a working example of valign behavior

if you want the text sitting slightly lower then why not lower it ?

  • Confused 1

Share this post


Link to post
Share on other sites

Because again, for the last time. I DO NOT want to manually adjust it. Even though I can. I would also like to know why it does it. RscTitle, doesn't do it. The reason behind it. I already know that valign works in some cases. So your posts are pretty useless.

Quote

8 posts

Joined: February 18, 2015

Maybe you just want MORE POSTS? More posts are worth nothing if the post itself is invaluable.

Share this post


Link to post
Share on other sites

no need to get rude and snarky
just trying to establish a understanding.. there is multiple ways to approach something
there was no mention of you manually adjusting just trying to see why you wouldn't just do that... every time i design a gui i just set positions of where i want things and your set

 

 

 

  • Like 1
  • Confused 1

Share this post


Link to post
Share on other sites

Are you serious? How many times do I have to repeat myself for it to sink into your head? How many posts do you need to make to get an understanding? I explained it in the first post and again after your first post in this thread.

Quote

Using invisible gap as explained on Wiki doesn't work too well - isn't a reliable solution.

Literally put 1+1 together. Of course I've used the invisible spacing gap trick (&#160;).

53 minutes ago, HazJ said:

I am aware but if you read my question properly, you would of saw:

Adjusting the size to a lot larger value works but I don't really want the title bar text that big. You really think I don't read the Wiki? I even posted it in my first post. I even mentioned the gap which is (&#160;) as shown on the Wiki. I don't want to manually adjust it, I want an automatic solution not manual which is dependant on size='' and h value. All you've done is took a quick look at the Wiki and pasted a slightly modified edit. I am not having a go, I'm just saying, I did explain that in the first place. RscTitle doesn't have this problem for some reason but doesn't support structured text.

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

 

Btw, welcome to the forums.

Then you ASK again. Never mind me getting snarky, how about STOP replying to the thread with such bullsh*t useless information. Now this thread is HOT with useless information. Good one.


Can a moderator lock this thread?]

  • Like 1

Share this post


Link to post
Share on other sites

Don't play innocent. I told you a 100 (not literally) times, and you still f*cking persist to ask the same STUPID question. As for reasons, I don't know, that is why I made the thread. Providing an alt method isn't a solution and doesn't answer the big question "why?". How many more times are you going to post/ask/etc? I told you several times that it isn't a reliable solution and don't really want to always manually do that. What can't you understand that? I also said I already know how to do that SO WHY are you posting instructions? gtfo of the thread.

Share this post


Link to post
Share on other sites

read my post it shows u how to correctly set up valign and use it.... dont know why you ask for help and then someone gives you a working example you carry on crying

MY POST IS USING VALIGN!!!!!!!!!
ITS NOT SETTING POSITION!!!!!!!!!!!
 

VALIGN DOES HAVE EFFECT WHEN SETUP RIGHT

  • Like 1
  • Confused 1

Share this post


Link to post
Share on other sites

Good for you. Maybe put that in the first place instead of post boosting with useless sh*t all the time. Also, I can't even read your code as you couldn't even use the correct CODE tags. Besides, I couldn't careless if it actually is a solution or not at this point. The fact that I had to post several times to your inability to read and post properly in the first place has put me off so. Just waiting for moderator to lock/hide.

Share this post


Link to post
Share on other sites

Back in the days we ended arguments under 4 eyes in the backyard of an abandoned factory.

Not that easy over forum posts, well maybe I'll live the day to see teleporters become a thing...

 

5 hours ago, HazJ said:

The reason behind it.

Doubt that someone other than the dev who implemented it can give a proper reasoning.

Same goes for why most script commands are always overriden by default AI (i.e.: make vehicle always have its lights on, no matter the behavior etc...)

 

Only thing I can think of is to somehow work out the screen coordinates of the control, get its center position and align the text from there, your usual workaround.

 

Cheers

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Yeah... A bit like playerViewChanged eh? :rofl::rofl:

  • Like 1

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×