Bom, fiz um sisteminha simples aqui pro vxa, ele basicamente solta um pop up quando tu recebe gold xD
Nâo vou por screens, testem ai e vejam o resultado kkk
Nâo vou por screens, testem ai e vejam o resultado kkk
- Código:
class Gold_PopUp < Sprite
attr_accessor :value, :icon
def initialize
super
self.x = $game_player.screen_x
self.y = $game_player.screen_y - 50
self.bitmap = Bitmap.new(100, 50)
@value = 0
@icon = 0
end
def refresh
self.bitmap.clear
self.bitmap.font.size = 13
draw_icon(@icon, 0, 0)
self.bitmap.draw_text(23, -9, self.width, self.height, @value.to_s, 0)
end
def draw_icon(icon_index, x, y, enabled = true)
img = Cache.system("Iconset")
rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
self.bitmap.blt(x, y, img, rect, enabled ? 255 : translucent_alpha)
end
def update
if Graphics.frame_count % 5 == 0
$pop_up.opacity -= 15
$pop_up.y -= 2
if $pop_up.opacity == 0
$pop_up.dispose
$pop_up = nil
$active = false
end
end
end
end
class Game_Party
alias :gold_pop :gain_gold
def gain_gold(amount)
if defined?($active)
return if $active
end
@gold = [[@gold + amount, 0].max, max_gold].min
$pop_up = Gold_PopUp.new
$pop_up.value = amount
$pop_up.icon = 361
$pop_up.refresh
$active = true
end
end
class Scene_Map
alias :popup_main :main
def main
$pop_up = Gold_PopUp.new
popup_main
$pop_up.dispose if !$pop_up.nil?
end
alias :popup_update :update
def update
popup_update
$pop_up.update if !$pop_up.nil?
end
end