Having some troubles with this sprite class. Here's the code I have for the update method.
self.bitmap.clear
width = self.bitmap.width
height = self.bitmap.width
twidth = self.bitmap.text_size(@text).width
self.bitmap.font.color.set(255, 255, 255)
self.bitmap.fill_rect(self.x, self.y, width, height, Color.new(0, 0, 0))
if @over
color = Color.new(0, 0, 200)
self.bitmap.fill_rect(self.x+1, self.y+1, width, height, color)
else
color = Color.new(255, 255, 255)
self.bitmap.fill_rect(self.x+1, self.y+1, width, height, color)
end
self.bitmap.font.color = Color.new(0, 0, 0)
self.bitmap.draw_text(0, 16, width, height, @text, 0)
It draws the blue rectangle if @over is true. And a white rectangle if @over is false. It does what its supposed to do. The only problem is it doesn't draw the text. Any ideas?