blockoo
|
  |
| Joined: 08 Nov 2007 |
| Total Posts: 17202 |
|
|
| 31 Jul 2014 09:10 PM |
| I'm learning how to use ScrollingFrames, and I'm trying to make a large text area where the person can freely type off the right side of the screen and the bottom of the screen. When the person reaches the edge of the screen, I want the frame to automatically scroll over so they don't have to manually scroll over to keep typing. The problem I'm having with this is determining the position of the pointer (the bar that the text appears behind). I'm not looking for the mouse position. Also, the TextBounds property won't work because I want them to be able to go back and edit what they have already typed (so the end of the text won't necessarily be where the pointer is). |
|
|
| Report Abuse |
|
|
|
| 31 Jul 2014 09:50 PM |
Well, you can't really get it directly... What if you found out where the mouse clicked to capture the focus on the TextBox and figured out the letter that it was under (maybe have a table of all the kerning/width data for each character and add it all up until it's close to the mouse's relative position).
Now you have the letter that was clicked, you can use that table to figure out how much the pointer moves each time the text changes.
Really though, there's not a good way.
I suggest make your own custom textbox, honestly. |
|
|
| Report Abuse |
|
|
blockoo
|
  |
| Joined: 08 Nov 2007 |
| Total Posts: 17202 |
|
|
| 31 Jul 2014 09:57 PM |
| I suppose I could do that. It's gonna be a pain though. Also, if I try making a custom text box, if the person presses W won't they move forward and type W at the same time? Honestly I thing that would end up being more work. |
|
|
| Report Abuse |
|
|
|
| 31 Jul 2014 09:59 PM |
It probably would be a ton of work, but there's not really a way to do it that wouldn't be.
Also, check out UserInputService and the wiki page on controlling a player's character. |
|
|
| Report Abuse |
|
|