How do I fix text box focus?

Get help using Construct 2

Post » Fri Aug 26, 2016 2:24 am

Hi!,

So I'm modifying scirra's online multiplayer example, and I've hit a bump.

I want to make it so that when you press enter, the chat text box appears and gets focused. I don't want it visible all the time. I added the event "when press enter -> focus", but when I press enter it only changes to visible, and I have to click it to focus it.

Any help is appreciated. Line 75.

https://dl.dropboxusercontent.com/u/200 ... layer.capx

Thanks!
B
26
S
8
Posts: 85
Reputation: 1,724

Post » Fri Aug 26, 2016 3:03 am

You can fix it by putting the tiniest of waits in between visible and focused, like 0.1 seconds.
B
53
S
21
G
94
Posts: 2,425
Reputation: 55,563

Post » Fri Aug 26, 2016 3:14 am

plinkie wrote:You can fix it by putting the tiniest of waits in between visible and focused, like 0.1 seconds.


A million thanks! It works now.
B
26
S
8
Posts: 85
Reputation: 1,724

Post » Fri Aug 26, 2016 3:28 am

use a clobal variable name ChatoOn/off : 1

keybord on return presses
System trigger once add 1 ChatoOn/off


system ChatoOn/off = 1 set chatTextbox focused

system ChatoOn/off = 2 set chatTextbox unfocused

system ChatoOn/off > 2 set ChtaOn/Off= 1
B
17
S
7
G
7
Posts: 205
Reputation: 5,335


Return to How do I....?

Who is online

Users browsing this forum: gloater2 and 4 guests