Jump to content
Sign in to follow this  
Undeceived

(Dialogs) How to create a scrollable text dialog window?

Recommended Posts

Hello,

does anyone know how to create a dialog window with scrollable text? I have much text to put in this dialog, but the as the text is not scrollable at the moment, the player can only read the first half of it.

scrollbarneeded.png

The text windows needs a scrollbar so the player can scroll down and read on.

Can anyone help? Many thanks!

Edited by Undeceived

Share this post


Link to post
Share on other sites

You can always put text in smaller parts. ;)

I dont know if you add dialogs/text lines in triggers or in scripts.

If in script you have something like this for example:

titletext ["Officer: BLABLABLA very long text we dont see all of it on screen.","plain down", 1]
~6
titletext ["Soldier: Yes sir.","plain down", 1]
~6
titletext ["","plain", 1]
~1

You can always add text in smaller parts, something like this:

titletext ["Officer: BLABLABLA smaller part of text, part1.","plain down", 1]
~6
titletext ["Officer: BLABLABLA smaller part of text, part2.","plain down", 1]
~6
titletext ["Soldier: Yes sir.","plain down", 1]
~6
titletext ["","plain", 1]
~1

Share this post


Link to post
Share on other sites

tom3kb, thanks, but I noticed that my topic title was a bit confusing. :D I'm not talking about dialogs like conversation, but dialogs as a scripted window and button system. :)

In my case the scripts look like this:

UI.hpp

class PERSON_DESCRIPTION_TEXT: RscStructuredText
	{
		idc = 1100;
		text = "";
		x = (0.617349 - 0.030) * safezoneW + safezoneX;
		y = 0.298634 * safezoneH + safezoneY;
		w = 0.123532 * safezoneW;
		h = 0.19052 * safezoneH;
	};

defines.hpp

class RscStructuredText
{
access = ReadAndWrite;
type = CT_STRUCTURED_TEXT;
idc = -1;
style = ST_CENTER + ST_MULTI;
lineSpacing = 1;
w = 0.1;
h = 0.05;
size = 0.02;
colorBackground[] = {0,0,0,0};
colorText[] = {0,0,0,0};
text = "";
font = "Zeppelin33";

class Attributes
{
	font = "Zeppelin33";
	color = "#ffffff";
	shadow = false;
};
};

UIfunctions.sqf (the script which "launches" the text)

((uiNamespace getVariable "myDisplay") displayCtrl 1100) ctrlSetStructuredText parseText format[localize "STR_Description_Kamil"];

And the result is this:

scrollbarneeded.png

As you can see, the text is cut as it reaches the bottom of the dialog window.

How do I add a scrollbar to this window so that the player can scroll down the text? Do I have to work with RscStructuredText in the UI.hpp at all?

Edited by Undeceived

Share this post


Link to post
Share on other sites

Sorry for bumping this - can't find an answer on my own...

Can anyone help?

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  

×