summaryrefslogtreecommitdiffhomepage
path: root/dragon/attr_sprite.rb
diff options
context:
space:
mode:
authorAmir Rajan <[email protected]>2021-04-10 03:51:14 -0500
committerAmir Rajan <[email protected]>2021-04-10 03:51:14 -0500
commit00e85147c9a1dd35a0857f361e5833a1c25f4a0a (patch)
tree52534d292ca3fa5733584eb926116228cb3551af /dragon/attr_sprite.rb
parenta2d92c2bf09bcdc494f1391af69b707cca281a16 (diff)
downloaddragonruby-game-toolkit-contrib-00e85147c9a1dd35a0857f361e5833a1c25f4a0a.tar.gz
dragonruby-game-toolkit-contrib-00e85147c9a1dd35a0857f361e5833a1c25f4a0a.zip
Synced from DRGTK 2.10.
Diffstat (limited to 'dragon/attr_sprite.rb')
-rw-r--r--dragon/attr_sprite.rb27
1 files changed, 14 insertions, 13 deletions
diff --git a/dragon/attr_sprite.rb b/dragon/attr_sprite.rb
index 81701ec..69ddd8c 100644
--- a/dragon/attr_sprite.rb
+++ b/dragon/attr_sprite.rb
@@ -4,26 +4,35 @@
# @private
module AttrRect
+ include GTK::Geometry
+
def left
- @x
+ (@x || self.x)
end
def right
- @x + @w
+ (@x || self.x) + (@w || self.w)
end
def bottom
- @y
+ (@y || self.y)
end
def top
- @y + @h
+ (@y || self.y) + (@h || self.h)
+ end
+
+ def x1
+ (@x || self.x)
+ end
+
+ def y1
+ (@y || self.y)
end
end
module AttrSprite
include AttrRect
- include GTK::Geometry
attr_accessor :x, :y, :w, :h, :path, :angle, :a, :r, :g, :b, :tile_x,
:tile_y, :tile_w, :tile_h, :flip_horizontally,
@@ -38,18 +47,10 @@ module AttrSprite
self
end
- def x1
- @x
- end
-
def x1= value
@x = value
end
- def y1
- @y
- end
-
def y1= value
@y = value
end