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
25
S
8
Posts: 81
Reputation: 1,691

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
45
S
15
G
73
Posts: 2,000
Reputation: 43,382

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
25
S
8
Posts: 81
Reputation: 1,691

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
15
S
7
G
7
Posts: 201
Reputation: 5,277


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest