Fitur
- Bisa munculin text damage sendiri tanpa mesti pake ABS
Screenshots
Scripts
Code: |
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Damage Pop Up # Author : LiTTleDRAgo #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:= module LiTTleDRAgo DMGFONT = "Calibri" # Damage font DMGSIZE = 17 # Ukuran font DMGBOLD = true DMGITALIC = true end class Damage_String < Sprite include LiTTleDRAgo def initialize(id = -1, s = "", r = 0, c = Color.new(255,255,255)) super(Viewport.new(0,0,640,480)); self.bitmap = Bitmap.new(96,32) self.bitmap.font.name = DMGFONT; self.bitmap.font.size = DMGSIZE self.bitmap.font.bold = DMGBOLD; self.bitmap.font.italic = DMGITALIC self.bitmap.font.color = Color.new(0,0,0) self.bitmap.draw_text(1,1,96,32,s.to_s,1); self.bitmap.font.color = c self.bitmap.draw_text(0,0,96,32,s.to_s,1) self.x = $game_player.screen_x - 48 - r + 2*rand(r) if id == -1 self.y = $game_player.screen_y - 48 - r + 2*rand(r) if id == -1 self.x = $game_map.events[id].screen_x - 48 - r + 2*rand(r) if id > 0 self.y = $game_map.events[id].screen_y - 48 - r + 2*rand(r) if id > 0 self.z = 1000; @opacity = 0 end def update; self.y -= 2; @opacity += 0.5; self.opacity -= @opacity; end end class Scene_Map alias_method :damage_main, :main alias_method :damage_update, :update def main; @damage = []; damage_main; end def damage(id = -1, s = "", r = 0, c = Color.new(255,255,255)) @damage << Damage_String.new(id, s, r, c);end; def update @damage.each_with_index{ |d,i| d.update} @damage.delete_if { |d| d.opacity == 0 ? true : false} damage_update end end |
Caranya, kalo mau bikin damage sendiri ketik kode ini di script call
Code: |
$scene.damage(event, string, random, color)
|
event = ID event yg jadi target (player = -1), kalo 0 ga ngaruh
string = string damagenya (jangan lupa string itu pake tanda ' ')
random = posisi damagenya (usahain angkanya jangan kebanyakan)
> (rekomendasi antara 0 - 10 aja)
color = warnanya
syntax : Color.new(R, G, B)
contoh
Code: |
$scene.damage(-1, 'meong is kucing', 0, Color.new(255,0,0))
|
artinya damagenya akan berwarna merah dengan tulisan meong is kucing terus muncul diatas kepala player
oh iya kalo ga mau repot begini saja dah cukup kok
Code: |
$scene.damage(-1, 'meong is kucing')
|
nanti damagenya akan berwarna putih biasa (default)
kalo mau munculin variabel contohnya seperti ini
Code: |
x = $game_variables[1] $scene.damage(-1, x.to_s, 0, Color.new(255,0,0)) |
nanti damagenya akan sama seperti variabel 1, warna merah, terus muncul diatas kepala player
0 komentar:
Posting Komentar