Type your name?

For questions about using Classic.

Post » Mon Dec 14, 2009 10:43 pm

I'm trying to make a name entry screen at the beginning of my game where the player... types their name. I'd rather not do the select-a-letter ala old school if I can help it. Ideally I'd like the name to show up on the screen as they're typing it and then store the name somewhere. Also, when I do get the name how do I get it to show up in my text?

A little help for the lost please? :?
B
2
G
3
Posts: 19
Reputation: 888

Post » Mon Dec 14, 2009 10:58 pm

Quick and dirty example.

http://dl.dropbox.com/u/1646976/textinput.cap

Name is stored as a Global Variable 'Name'.

Hope it helps
B
46
S
23
G
7
Posts: 459
Reputation: 6,763

Post » Mon Dec 14, 2009 11:05 pm

Hum.

Useful, though having to click on the screen in a game with no other mouse "stuff" is a bit out of context. Is there a way to have it clicked by default?
B
2
G
3
Posts: 19
Reputation: 888

Post » Mon Dec 14, 2009 11:12 pm

Yes.

On the start of layout event add Edit Box: Focus On.

You could delete the first action in the start of layout event if you want the edit box to be blank, to save having to delete the default 'No Name'.

Or add the action Editbox: Select All so as soon as a letter is typed the default text is deleted automatically.

**EDIT**

I've updated the example in my first post.
B
46
S
23
G
7
Posts: 459
Reputation: 6,763

Post » Mon Dec 14, 2009 11:15 pm

That should do it. Thanks! :D
B
2
G
3
Posts: 19
Reputation: 888


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 7 guests