[solved] catch and modify the cursor position in a text

Get help using Construct 2

Post » Wed Jul 23, 2014 4:20 pm

Hi Everyone, this question is kind of tuff i know, so an answer will be gladly appreciate.

How do I catch and modify the cursor position in a textbox. By "cursor" i mean this litlle blinking bar in every textbox (or textfield).

Many Thanks

[edit] Solution (pluggin) : https://www.scirra.com/forum/plugin-custom-input_t109565
Last edited by midward on Thu Jul 24, 2014 5:15 pm, edited 2 times in total.
B
14
S
1
Posts: 33
Reputation: 1,022

Post » Wed Jul 23, 2014 8:31 pm

I don't know if you can do that by code, I've seens posts about this "cursor" before, use the search option and look for something related to typewriter
Please tag me with @caiorosisca if your post is refering to me :). I don't always follow the topics I answer.
B
11
S
4
G
1
Posts: 272
Reputation: 1,643

Post » Wed Jul 23, 2014 10:45 pm

Nope, there is no satisfying answer in those post, they'r about the typewriter effect. However Thank you for your reply.
B
14
S
1
Posts: 33
Reputation: 1,022

Post » Thu Jul 24, 2014 12:58 am

It's not perfect but does what you want if want to move it's index. plugin-custom-input_t109565
B
11
S
2
G
1
Posts: 202
Reputation: 1,580

Post » Thu Jul 24, 2014 5:11 pm

Awesome "Noncentz", it take me several hours to understand what i'm doing but i have adapted your code (the selectionStart part) to text-area and it works !!!! Thank u, now i hope to do the same for the insert "option"....

Amazing pluggin, i keep it for further works... Really good dude, how can i give u point of reputation ?
B
14
S
1
Posts: 33
Reputation: 1,022

Post » Sat Jul 26, 2014 5:26 am

:) Thank me by testing my plugins and maybe you could suggest these kind of features be added.
For now here's a behavior, that should do that for textbox. https://dl.dropboxusercontent.com/u/139 ... terpos.zip ...
B
11
S
2
G
1
Posts: 202
Reputation: 1,580

Post » Wed Dec 31, 2014 9:40 pm

@Noncentz705 , I modified your behavior to work with wordwrapping. Just have to include the lineBreak expression in an event like shown in the example capx. Hope you don't mind.
You do not have the required permissions to view the files attached to this post.
B
47
S
22
G
65
Posts: 1,127
Reputation: 38,395


Return to How do I....?

Who is online

Users browsing this forum: R0J0hound and 24 guests