Show list of text with format

Get help using Construct 2

Post » Sat Aug 25, 2012 12:15 pm

Hi

Im trying to make a list of objects that you must find in the game. I though that text will be enough and i avoid the use of many images.

So i have a sprite of a pencil and a bucket, each one with a variable name for example.

I can make a loop and record that names in an array using families.

But i dont know how to show the list afterwards.

I created a text object and i wrote the array(0) + " " + array(1), but all in a line. Can i introduce a break line or width atribute, or write html maybe?

Then I tried to create a Text object for each line, line0, line1, .... But i dont know how to make a loop that changes the object name. For example:

for i,1,numobjects
text&i.text=array(i)

The objective is a list like:

pencil
bucket

Thank you
B
3
Posts: 27
Reputation: 904

Post » Sat Aug 25, 2012 4:12 pm

Excuse me.

Searching in the forum finally i found the sintaxis:
Array: For Each element
-> Text: Set text to Text.Text&NewLine&Array (Array.CurrentX)

It was simple but until now i was not able to find it.

Thanks to all for this great forum
B
3
Posts: 27
Reputation: 904

Post » Sat Aug 25, 2012 4:20 pm

Im still searching how to give format to the line (not only text) but as soon as i locate it i will link it here

Thanks
B
3
Posts: 27
Reputation: 904

Post » Sat Aug 25, 2012 7:00 pm

You can format the whole text object but not just lines of it. To have different formatting per line create a different text instance per line.
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Sun Aug 26, 2012 3:42 pm

Thank you. I was still searching.

I cant create an array or dictionary of Sprites also. And i dont know how to make a loop through Sprite names something0, something1, something2,...

So I think the solution is to create a family and loop through all objects in it, setting text to a variable value inside the text object.

Lets try then :)

Thank you very much
B
3
Posts: 27
Reputation: 904

Post » Sun Aug 26, 2012 4:30 pm

I finally found this

http://www.scirra.com/forum/plugins-pode-html-pack_topic51522_post324677.html

which lets me add CSS styles.

Thank you very much again for this great community
B
3
Posts: 27
Reputation: 904


Return to How do I....?

Who is online

Users browsing this forum: Pandadoor, Sotir31 and 24 guests