赞 | 4 |
VIP | 0 |
好人卡 | 0 |
积分 | 77 |
经验 | 15725 |
最后登录 | 2024-10-31 |
在线时间 | 1332 小时 |
Lv4.逐梦者
- 梦石
- 0
- 星屑
- 7714
- 在线时间
- 1332 小时
- 注册时间
- 2015-8-15
- 帖子
- 749
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
用class Sprite_Character < RPG::Sprite
还是用class Sprite_map < RPG::Sprite
class Window_kg_status < Window_Base class Sprite_Character < RPG::Sprite #我方 def initialize(actor_id, window_index) super(540 - window_index * 76 , 540, 117, 190) @actor_id = actor_id self.contents = Bitmap.new(width - 1, height- 1 ) self.opacity = 0 refresh end def dispose super end def refresh self.contents.clear #draw_actor_name($game_actors[@actor_id], 0, 0) draw_actor_picture($game_actors[@actor_id].battler_name, $game_actors[@actor_id].battler_hue, -1 ,+1) draw_actor_hp($game_actors[@actor_id], 1, 110) draw_actor_sp($game_actors[@actor_id], 134, 135) draw_actor_cp($game_actors[@actor_id], 134, 160) end class Window_Base < Window #我方 def draw_actor_cp(actor, x, y, width = 90, height = 15) w = [actor.cp, 100].min / 100 * width self.contents.fill_rect(x, y, width,height,Color.new(0,0,0)) self.contents.fill_rect(x, y + 1 , width,height -2,Color.new(255, 255, 128)) self.contents.fill_rect(x + 1, y + 1, w, height -2,Color.new(255,255,255)) end def draw_actor_picture(actor_name, actor_hue, x, y) bitmap = RPG::Cache.battler(actor_name,actor_hue) src_rect = Rect.new(0, 0, bitmap.width, bitmap.height) self.contents.blt(x, y, bitmap, src_rect) end
class Window_kg_status < Window_Base
class Sprite_Character < RPG::Sprite
#我方
def initialize(actor_id, window_index)
super(540 - window_index * 76 , 540, 117, 190)
@actor_id = actor_id
self.contents = Bitmap.new(width - 1, height- 1 )
self.opacity = 0
refresh
end
def dispose
super
end
def refresh
self.contents.clear
#draw_actor_name($game_actors[@actor_id], 0, 0)
draw_actor_picture($game_actors[@actor_id].battler_name, $game_actors[@actor_id].battler_hue, -1 ,+1)
draw_actor_hp($game_actors[@actor_id], 1, 110)
draw_actor_sp($game_actors[@actor_id], 134, 135)
draw_actor_cp($game_actors[@actor_id], 134, 160)
end
class Window_Base < Window
#我方
def draw_actor_cp(actor, x, y, width = 90, height = 15)
w = [actor.cp, 100].min / 100 * width
self.contents.fill_rect(x, y, width,height,Color.new(0,0,0))
self.contents.fill_rect(x, y + 1 , width,height -2,Color.new(255, 255, 128))
self.contents.fill_rect(x + 1, y + 1, w, height -2,Color.new(255,255,255))
end
def draw_actor_picture(actor_name, actor_hue, x, y)
bitmap = RPG::Cache.battler(actor_name,actor_hue)
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(x, y, bitmap, src_rect)
end
|
|