Forums Archived

The forums are being archived. See this topic for more information.

Selecting Text

Discussion about anything related to Rubygame

Selecting Text

Postby shevegen » Thu Jul 09, 2009 1:34 pm

What is the simplest way to select text that a user entered? On IRC (when I asked how to select text from the ttf.rb sample file) one solution was to find out where the mouse clicked (probably left mouse button press, selection up until left mouse button release)

Did sound complicated.

Perhaps there are simpler ways, maybe even without ttf?

Basically I'd like to have a simple way to select what a user types in i.e. a "highscore" field - with pure keyboard a user is probably faster, but I am interested in the functionality of mouse-select -> copy selection to clickboard, and then pasting it outside rubygame too (on a Linux system, which seems easier. I dont really know much about windows...)
shevegen
 
Posts: 5
Joined: Sat Feb 07, 2009 3:04 pm

Re: Selecting Text

Postby shawn42 » Thu Jul 09, 2009 4:59 pm

A good start would be to look at TextField from rubygoo:
http://code.google.com/p/rubygoo/
http://code.google.com/p/rubygoo/source ... t_field.rb

I'm sure you could figure something out from that... I don't know how to send text to the copy-buffer though. (Maybe that's a feature request for Rubygame 3.0?) :D
User avatar
shawn42
 
Posts: 109
Joined: Tue Feb 10, 2009 8:22 pm


Return to Rubygame (General)

Who is online

Users browsing this forum: No registered users and 1 guest

cron