summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorTom Black <[email protected]>2016-08-28 18:10:05 -0400
committerGitHub <[email protected]>2016-08-28 18:10:05 -0400
commit31aebd27ec78e6b751d69d2fb360187270b1be00 (patch)
tree29c35b0dccbd4b2ac0108f1c402be568e06205b7 /lib
parent91676a0713c0dfd9a11c2b2b1ba0d50eb5d60534 (diff)
parent4206c7d84977e40d092610fe35e2d937d693bd1c (diff)
downloadruby2d-31aebd27ec78e6b751d69d2fb360187270b1be00.tar.gz
ruby2d-31aebd27ec78e6b751d69d2fb360187270b1be00.zip
Merge pull request #18 from mikeappell/change-text-dynamically
Made Text objects changeable dynamically
Diffstat (limited to 'lib')
-rw-r--r--lib/ruby2d/text.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/ruby2d/text.rb b/lib/ruby2d/text.rb
index a695b31..9ba4e41 100644
--- a/lib/ruby2d/text.rb
+++ b/lib/ruby2d/text.rb
@@ -2,11 +2,11 @@
module Ruby2D
class Text
-
+
attr_accessor :x, :y, :size, :text
def initialize(x=0, y=0, size=20, msg="Hello World!", font="Arial", c="white")
-
+
if File.exists? font
@font = font
else
@@ -29,7 +29,7 @@ module Ruby2D
end
def text=(t)
-
+ @text = t
end
def remove
@@ -43,7 +43,7 @@ module Ruby2D
def resolve_path(font)
if RUBY_PLATFORM =~ /darwin/
font_path = "/Library/Fonts/#{font}.ttf"
- else
+ else
# Linux
font_path = "/usr/share/fonts/truetype/#{font}.ttf"
end