summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/ruby2d/image.rb3
-rw-r--r--lib/ruby2d/sprite.rb2
-rw-r--r--lib/ruby2d/text.rb10
-rw-r--r--lib/ruby2d/triangle.rb2
4 files changed, 8 insertions, 9 deletions
diff --git a/lib/ruby2d/image.rb b/lib/ruby2d/image.rb
index 2e18b44..dad263b 100644
--- a/lib/ruby2d/image.rb
+++ b/lib/ruby2d/image.rb
@@ -3,7 +3,8 @@
module Ruby2D
class Image
- attr_accessor :x, :y
+ attr_accessor :x, :y, :width, :height, :data
+ attr_reader :path
def initialize(x, y, path)
diff --git a/lib/ruby2d/sprite.rb b/lib/ruby2d/sprite.rb
index e327f7f..c04614a 100644
--- a/lib/ruby2d/sprite.rb
+++ b/lib/ruby2d/sprite.rb
@@ -3,7 +3,7 @@
module Ruby2D
class Sprite
- attr_accessor :x, :y
+ attr_accessor :x, :y, :data
def initialize(x, y, path)
diff --git a/lib/ruby2d/text.rb b/lib/ruby2d/text.rb
index ab4a204..3cb901b 100644
--- a/lib/ruby2d/text.rb
+++ b/lib/ruby2d/text.rb
@@ -2,12 +2,10 @@
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
+ attr_accessor :x, :y, :size, :text, :data
+
+ def initialize(x=0, y=0, size=20, text="Hello World!", font="Arial", c="white")
# if File.exists? font
@font = font
@@ -17,7 +15,7 @@ module Ruby2D
@type_id = 5
@x, @y, @size = x, y, size
- @text, @color = msg, c
+ @text, @color = text, c
update_color(c)
if Module.const_defined? :DSL
diff --git a/lib/ruby2d/triangle.rb b/lib/ruby2d/triangle.rb
index 8d4f373..ad13688 100644
--- a/lib/ruby2d/triangle.rb
+++ b/lib/ruby2d/triangle.rb
@@ -6,7 +6,7 @@ module Ruby2D
attr_accessor :x1, :y1, :c1,
:x2, :y2, :c2,
:x3, :y3, :c3
- attr_reader :color
+ attr_reader :color, :type_id
def initialize(x1=50, y1=0, x2=100, y2=100, x3=0, y3=100, c='white')
@type_id = 1