summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorlstrzebinczyk <[email protected]>2017-03-20 21:35:07 +0100
committerTom Black <[email protected]>2017-03-27 13:45:54 -0400
commit79c50dab7f06e4ec288e79e61d0631fdf07b7264 (patch)
tree810156ff621084c9bf6268b1f4577ba82fb19b3e /lib
parent54b00eb9d3cba566bf80daf6be4c93c1149a7633 (diff)
downloadruby2d-79c50dab7f06e4ec288e79e61d0631fdf07b7264.tar.gz
ruby2d-79c50dab7f06e4ec288e79e61d0631fdf07b7264.zip
Text#text= will inspect it's input
Diffstat (limited to 'lib')
-rw-r--r--lib/ruby2d/text.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/ruby2d/text.rb b/lib/ruby2d/text.rb
index 22325ff..ca27ab8 100644
--- a/lib/ruby2d/text.rb
+++ b/lib/ruby2d/text.rb
@@ -16,12 +16,17 @@ module Ruby2D
@type_id = 5
@x, @y, @size = x, y, size
- @text = text
+ @text = text.to_s
@color = Color.new(c)
init
add
end
+ def text=(msg)
+ @text = msg.to_s
+ ext_text_set(@text)
+ end
+
def color=(c)
@color = Color.new(c)
end