Method: LUIT::TextArea#update

Defined in:
lib/luit.rb

#update(x = 0, y = 0) ⇒ Object



146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# File 'lib/luit.rb', line 146

def update(x = 0, y = 0)
	super
	x += @x
	y += @y
	updateHover(x, y)
	if @field.text.size > @maxChar
		@field.text = @field.text[0..@maxChar]
	end
	if @typing
		@window.text_input = @field
	elsif @window.text_input == @field
		@window.text_input = nil
	end
	if Gosu::button_down?(Gosu::KbReturn) && @typing
		@typing = false
		@window.text_input = nil
		@holder.onClick(@id)
	end
end