lib/cyberarm_engine/objects/text.rb in cyberarm_engine-0.1.0 vs lib/cyberarm_engine/objects/text.rb in cyberarm_engine-0.2.0
- old
+ new
@@ -65,11 +65,11 @@
def width
textobject.text_width(@text)
end
def height
- textobject.height
+ @text.lines.count * textobject.height
end
def draw
if @shadow && !ARGV.join.include?("--no-shadow")
_color = Gosu::Color.rgba(@color.red, @color.green, @color.blue, @shadow_alpha) if @shadow_alpha <= @color.alpha
@@ -87,9 +87,17 @@
@textobject.draw_markup(@text, @x+@shadow_size, @y, @z, @factor_x, @factor_y, _color)
@textobject.draw_markup(@text, @x+@shadow_size, @y+@shadow_size, @z, @factor_x, @factor_y, _color)
end
@textobject.draw_markup(@text, @x, @y, @z, @factor_x, @factor_y, @color)
+ end
+
+ def alpha=(n)
+ @color = Gosu::Color.new(@color.red, @color.green, @color.blue, n)
+ end
+
+ def alpha
+ @color.alpha
end
def update; end
end
end