ray icon indicating copy to clipboard operation
ray copied to clipboard

How can I get the position of the text on the screen?

Open kingsleyh opened this issue 10 years ago • 0 comments

on :text_entered do |text| @text_entered <<Ray::TextHelper.convert(text) end render do window.clear Ray::Color.gray window.draw text(@text_entered.join(''), :size => 15, :style => [:bold]) end

When I draw text - It always is 0,0 position as it just renders the array of text - however I want to put a cursor on the end - but can't work out how to move my cursor to the end of the text - as I can't calculate the pixel location for the end of the text.

Any suggestions how to do this? I basically want to emulate an editor.

kingsleyh avatar Jan 25 '15 15:01 kingsleyh