From 79c50dab7f06e4ec288e79e61d0631fdf07b7264 Mon Sep 17 00:00:00 2001 From: lstrzebinczyk Date: Mon, 20 Mar 2017 21:35:07 +0100 Subject: Text#text= will inspect it's input --- lib/ruby2d/text.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib') 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 -- cgit v1.2.3