generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Position of pointer in a text box

Previous Thread :: Next Thread 
blockoo is not online. 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
nicemike40 is not online. nicemike40
Joined: 19 Dec 2008
Total Posts: 1814
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 is not online. 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
nicemike40 is not online. nicemike40
Joined: 19 Dec 2008
Total Posts: 1814
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image