simple text box issue

Get help using Construct 2

Post » Sat Feb 16, 2013 9:27 am

So i've tried to show a variable in a textbox. Simple thing.

This example (https://www.scirra.com/tutorials/257/lets-make-a-calculator ; the first one that poped on google) shows many things not related, but it does eventually explain how to do so.

"Add an event-> On start of layout -> Action -> TextBox -> Set Text -> textbox.
If you run your project, you'll see the textbox with a 0 there. It's working. :)"


But for me this is not working. If I enter only the name of a global variable, nothing shows up in the text box. Even in the the calculator example, if I run it as it is, nothing shows up in the text area.

I've found a way around, it's to enter ""&variable in the text feild. But is it suppose to be like that ?PoulpeHibou2013-02-16 09:28:43
B
6
Posts: 3
Reputation: 735

Post » Sat Feb 16, 2013 10:47 am

There are two text options (that I know of) in C2. one is the general text (ie display some text) and the other is the form control text box.(ie user can enter text here)

If you use the general text display then you can do as you say above but (I guess) because the form control is waiting for some text you don't appear to be able to - except with the "" &variable .

have a quick look at:

text box exampleRamPackWobble2013-02-16 10:51:30
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
59
S
30
G
34
Posts: 1,194
Reputation: 23,777

Post » Sat Feb 16, 2013 11:19 am

You can use str function.
TextBox -> Set Text -> str(VariableName)
B
20
S
8
G
6
Posts: 176
Reputation: 8,047

Post » Sat Feb 16, 2013 11:46 am

Ooookay. So i've been using the wrong kind of object all time. Tanks a lot, i was really starting to think something was wrong with my PC.
B
6
Posts: 3
Reputation: 735

Post » Sat May 07, 2016 1:08 pm

Get gud
B
5
S
1
Posts: 2
Reputation: 326


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 16 guests