赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 18684 |
最后登录 | 2020-5-5 |
在线时间 | 9 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 60
- 在线时间
- 9 小时
- 注册时间
- 2006-9-7
- 帖子
- 303
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
在战斗中显示敌人的名字,但是名字会显示在法术之上,怎么修改在法术之下?
脚本:
- #==============================================================================
- # 本脚本来自www.66RPG.com,使用和转载请保留此信息
- #==============================================================================
- # ■ エネミーHP&SP(ver 0.98)
- # □ カスタマイズポイント
- #==============================================================================
- module PLAN_HPSP_DRAW
- FONT_NAME = ["宋体"] # フォント
- FONT_SIZE = 16 # フォントサイズ
- FONT_BOLD = true # 太字
- FONT_ITALIC = false # 斜体
-
- DRAW_NAME = true # 名前の描画
- DRAW_HP = false # HP の描画
- DRAW_SP = false # SP の描画
- DRAW_WIDTH = 80 # 描画幅
- DRAW_HEIGHT = 3 * 32 # 描画高さ
- DRAW_SPACE = 0 # 行間
- DRAW_Y = 54 # Y 座標修正値
- end
- #==============================================================================
- # ■ Sprite_Battler
- #==============================================================================
- class Sprite_Battler < RPG::Sprite
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- alias plan_enemy_hpsp_draw_initialize initialize
- def initialize(viewport, battler = nil)
- # 元のメソッドに戻す
- plan_enemy_hpsp_draw_initialize(viewport, battler)
-
- # エネミーの場合
- if @battler.is_a?(Game_Enemy)
- width = PLAN_HPSP_DRAW::DRAW_WIDTH + 32
- height = PLAN_HPSP_DRAW::DRAW_HEIGHT + 32
-
- x = @battler.screen_x - width / 2
- y = @battler.screen_y - height + 32 + PLAN_HPSP_DRAW::DRAW_Y
-
- @enemy_hpsp_window = Window_Base.new(x, y, width, height)
- @enemy_hpsp_window.contents = Bitmap.new(width - 32, height - 32)
- @enemy_hpsp_window.contents.font.color = Color.new(2, 112, 16, 255)
- @enemy_hpsp_window.contents.font.name = PLAN_HPSP_DRAW::FONT_NAME
- @enemy_hpsp_window.contents.font.size = PLAN_HPSP_DRAW::FONT_SIZE
- @enemy_hpsp_window.contents.font.bold = PLAN_HPSP_DRAW::FONT_BOLD
- @enemy_hpsp_window.contents.font.italic = PLAN_HPSP_DRAW::FONT_ITALIC
-
- y = 0
- @old_enemy_hpsp = []
- one_line = ((PLAN_HPSP_DRAW::FONT_SIZE * 100 / 28) * 32) / 100
-
- if PLAN_HPSP_DRAW::DRAW_NAME
- @enemy_hpsp_window.draw_actor_name(@battler, -15, y, width - 32)
- y += one_line + PLAN_HPSP_DRAW::DRAW_SPACE
- @old_enemy_hpsp.push(@battler.name)
- end
- @enemy_hpsp_window.opacity = 255
- @enemy_hpsp_window.contents_opacity = 255
- @enemy_hpsp_window.z = - 1
-
- end
- end
- #--------------------------------------------------------------------------
- # ● 解放
- #--------------------------------------------------------------------------
- alias plan_enemy_hpsp_draw_dispose dispose
- def dispose
- # エネミーの場合
- if @battler.is_a?(Game_Enemy)
- @enemy_hpsp_window.dispose
- end
- # 元のメソッドに戻す
- plan_enemy_hpsp_draw_dispose
- end
- #--------------------------------------------------------------------------
- # ● フレーム更新
- #--------------------------------------------------------------------------
- alias plan_enemy_hpsp_draw_update update
- def update
- # 元のメソッドに戻す
- plan_enemy_hpsp_draw_update
- # エネミーの場合
- if @battler.is_a?(Game_Enemy)
- @enemy_hpsp_window.visible = @battler_visible
- # スプライトの座標を設定
- width = PLAN_HPSP_DRAW::DRAW_WIDTH + 32
- @enemy_hpsp_window.x = self.x - width / 2
-
- @now_enemy_hpsp = []
-
- if PLAN_HPSP_DRAW::DRAW_NAME
- @now_enemy_hpsp.push(@battler.name)
- end
-
- if @old_enemy_hpsp != @now_enemy_hpsp and $game_temp.enemy_hpsp_refresh
- @old_enemy_hpsp = @now_enemy_hpsp
- @enemy_hpsp_window.contents.clear
- y = 0
- width = PLAN_HPSP_DRAW::DRAW_WIDTH + 32
- one_line = ((PLAN_HPSP_DRAW::FONT_SIZE * 100 / 28) * 32) / 100
-
- if PLAN_HPSP_DRAW::DRAW_NAME
- @enemy_hpsp_window.draw_actor_name(@battler, 0, y, width - 32)
- y += one_line + PLAN_HPSP_DRAW::DRAW_SPACE
- end
- Graphics.frame_reset
- end
-
- end
- end
- end
- #==============================================================================
- # ■ Window_Base
- #==============================================================================
- class Window_Base < Window
- #--------------------------------------------------------------------------
- # ● 名前の描画
- #--------------------------------------------------------------------------
- def draw_actor_name(actor, x, y, width = 120, align = 0)
- if $scene.is_a?(Scene_Battle)
- align = 1
- self.contents.font.color = Color.new(43, 212, 43, 255)
- else
- self.contents.font.color = normal_color
- end
- self.contents.draw_text(x, y, width, 32, actor.name, align)
- end
- end
复制代码
此贴于 2009-2-3 7:31:20 被版主darkten提醒,请楼主看到后对本贴做出回应。 版务信息:本贴由楼主自主结贴~ |
|