Jump to content
Sign in to follow this  
chronicsilence

CutText on top of Dialog

Recommended Posts

I have a custom dialog/display open. I need to present white text over top of it, preferably using the cutText or titleText functions. However, something like the following code:

createDialog "myCustomDialog";
cutText ["Hello World", "PLAIN"];

It shows the white text behind the dialog instead of on top of it. Noting from the wiki page that I can tell it to show on a specific layer, I tried

createDialog "myCustomDialog";
9999 cutText ["Hello World", "PLAIN"];

to try to force it to the front, but no luck. Is there any way to make it show up in front of an open dialog?

Share this post


Link to post
Share on other sites

You've created a dialogue? You could try to add that message in the dialogue itself.

Share this post


Link to post
Share on other sites
I have a custom dialog/display open. I need to present white text over top of it, preferably using the cutText or titleText functions. However, something like the following code:

createDialog "myCustomDialog";
cutText ["Hello World", "PLAIN"];

It shows the white text behind the dialog instead of on top of it. Noting from the wiki page that I can tell it to show on a specific layer, I tried

createDialog "myCustomDialog";
9999 cutText ["Hello World", "PLAIN"];

to try to force it to the front, but no luck. Is there any way to make it show up in front of an open dialog?

+ 1 to the post above mine. You could do it in the dialog itself (you could even leave the text field blank then write to it later using ctrlSetText).

Share this post


Link to post
Share on other sites

@DaVIdoSS: that's a very helpful video, I didn't know about some of those functions. It looks like all of the new ones he mentions that I didn't already try though (BIS_fnc_infoText, BIS_fnc_titleText, BIS_fnc_titleText2) all have funky animations that I'd prefer not to have to use.

@R3vo & austin_medic: adding it to the dialog might work. The issue with that though is that there's no command I'm aware of to fade a control in/out, and I'd really like a fade. You can use ctrlSetFade I suppose, but you'd have to spawn a script to repeatedly change the fade level.

EDIT: ahh, looks like I could fade it in over time with ctrlSetFade and then ctrlCommit (time). So things brings up a new point. I have a lot of dialogs, and I'd like a generalized solution to show a message over top of any of them. This means that I need to have a base dialog config class with the text message control which all the other dialogs inherit from, so I don't have to manually put the control in every new dialog I create (I could, it would just be messy programming practice). I cannot, however, figure out how to get a dialog config class to inherit controls from other config classes. For example:

// the base controls class containing my message text control
class cfg_controls_base
{
class cfg_control_testing : RscText_Background
{
	idc = 999;
	text = "TESTING";
	x = 0.5;
	y = 0.5;
	w = 5;
	h = 1;
};
};

// the dialog config that inherits the base controls
class cfg_dialog_test
{
idd = 200;
movingEnable = false;
enableSimulation = true;

class controls : cfg_controls_base
{
	class cfg_control_test2 :RscText_Background
	{
		idc = 1000;
		text = "ANOTHER TEST";
		x = 0.5;
		y = 1.5;
		w = 5;
		h = 1;
	};
};
};

This does not work, because the dialog class only shows the "ANOTHER TEST" control, and not the one it should inherit.

Edited by ChronicSilence

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×