Project1
标题: 怎么改这个脚本的Z坐标 [打印本页]
作者: 李梦遥 时间: 2011-5-2 14:34
标题: 怎么改这个脚本的Z坐标
本帖最后由 李梦遥 于 2011-5-2 14:35 编辑
我需要把这个脚本的高度调为最低,就是什么东西都显示在他上面。- #==============================================================================
- # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
- #==============================================================================
- # ■ エネミーHP&SP(ver 0.98)
- # □ カスタマイズポイント
- #==============================================================================
- module PLAN_HPSP_DRAW
- FONT_NAME = ["黑体"] # フォント
- FONT_SIZE = 16 # フォントサイズ
- FONT_BOLD = false # 太字
- FONT_ITALIC = false # 斜体
-
- DRAW_NAME = true # 名前の描画
- DRAW_HP = false # HP の描画
- DRAW_SP = false # SP の描画
- DRAW_WIDTH = 160 # 描画幅
- 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 = 0
- @enemy_hpsp_window.contents_opacity = 255
-
- 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
复制代码