class Core::Game::Bubble
Public Class Methods
new(text)
click to toggle source
Calls superclass method
Core::GUI::Textfield::new
# File lib/game/npc/bubble.rb, line 6 def initialize(text) super(0, 0, 0, 0, text, 20, :left, false, 256) @age = text.gsub("\n", "").size * Core.config[:text_speed] end
Public Instance Methods
draw(x, y)
click to toggle source
Calls superclass method
Core::GUI::Textfield#draw
# File lib/game/npc/bubble.rb, line 19 def draw(x, y) @x, @y = x-(@w/2)+16, y-40-@h super() c = Gosu::Color::GREEN Core.window.draw_triangle(@x+(@w/2)-4, @y+@h, c, @x+(@w/2)+4, @y+@h, c, @x+(@w/2), @y+@h+24, c, Core::MAPOBJECT_Z+100) end
update()
click to toggle source
# File lib/game/npc/bubble.rb, line 11 def update if @age <= 0 @remove = true else @age -= 1 end end