is it possible to create text label dynamically

Discussion and feedback on Construct 2

Post » Thu Feb 13, 2014 9:48 pm

i have some array of data that i want to display on the screen the data contain user name , country and a picture of the user.

Now i want to display these information,but i dont know how to generate text label dynamically on canvas...

if there is any sample or tip then kindly share it...i take the data from webstorage which contain around 20 different user information which i like to show on the canvas...


any idea???
B
9
S
2
Posts: 108
Reputation: 1,010

Post » Thu Feb 13, 2014 11:31 pm



(I've only put the webstorage thing in as a placeholder, don't try and replicate that part).

With the System/Create Object action you can create anything that's in your game at runtime then once you've created it you can assign it whatever properties you choose.
In the above example I created a textbox you could just as easily create text or better still spritefont text it's all the same process System/Create Object. Bertie Booster2014-02-13 23:55:09
There are 10 types of people in the World, those that understand binary and those who don't.
B
7
S
2
Posts: 93
Reputation: 797

Post » Fri Feb 14, 2014 12:01 am

not so easy to explain, if you dont know what is what but

you need a loop,

a for loop or repeat,

repeat 20 times, create txtobject, at 50,50+loopindex*txtobject.height
and set txtobject.txt to webstorage at key loopindex

do a search for these things...



ImageImage
B
70
S
21
G
7
Posts: 827
Reputation: 10,052

Post » Fri Feb 14, 2014 10:00 pm

thanks for your replies guys , but special thanks to @Bertie Booster who has explained in very precise and with perfect snapshot ...it was not that much hard though but got the proper direction.. once again thanks
B
9
S
2
Posts: 108
Reputation: 1,010


Return to Construct 2 General

Who is online

Users browsing this forum: David181, Refeuh and 8 guests