设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 3440|回复: 3
打印 上一主题 下一主题

[已经过期] sideview的战斗背景

[复制链接]

Lv1.梦旅人

梦石
0
星屑
154
在线时间
664 小时
注册时间
2011-9-25
帖子
241
跳转到指定楼层
1
发表于 2012-4-9 19:26:22 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
把游戏的分辨率变大之后,RTP里面的战斗背景就不能完全覆盖了。而sideview里面的战斗背景好像会自动填充?求高手帮我截取这一段的脚本,只要战斗背景能像sideview一样的功能就好了

Lv3.寻梦者

虚空人形

梦石
0
星屑
4557
在线时间
2037 小时
注册时间
2011-8-11
帖子
3398

贵宾

2
发表于 2012-4-10 12:24:17 | 只看该作者
本帖最后由 hcm 于 2012-4-10 12:25 编辑

那个应该不是自动填充吧,
我换用不同的图片测试发现是按百分比取了背景图片的一个固定区域。
大概就是小框这个区(大框为全图),在战斗时略有缩放和移动。

无标题-1.png (4.71 KB, 下载次数: 25)

无标题-1.png

点评

哦,原来如此~不知道是sideview是如何实现该功能的,想把它独立拿出来用  发表于 2012-4-10 15:48
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
47 小时
注册时间
2012-4-8
帖子
14
3
发表于 2012-4-10 13:55:42 | 只看该作者
本帖最后由 莲华乂乱舞 于 2012-4-10 18:06 编辑

sideview的不是自动填充  正好自己翻译到那边     是在SideViewアクション設定  里做了百分比放大     51行开始就是了  这里是输入百分比值   
然后再  Sprite_Sideview里  进行背景的绘制的时候  对高度宽度进行百分比缩放

关键字   FLOOR1_DATA   和  set_graphics(new_bitmap)   自学习下哦     PS  其实正好在汉化sideview到这里


‘‘──莲华乂乱舞于2012-4-10 17:52补充以下内容
好像不行   如果没理解错的话  SV 处理的时候  会跳过自带的  战斗绘制和处理吧

偶也是新手一枚  求高手指导  Spriteset_Battle  的修改方法   我用
@back2_sprite.bitmap.height=battleback2_bitmap.height*1.2
    @back2_sprite.bitmap.width=battleback2_bitmap.width*1.2

直接报错。。。。。   如果这里可以改的话  应该就是LZ需要的功能了   也可能不是这里。。。。
’’

点评

感谢解惑~话说能否把这个功能单独拿出来用呢?脚本太长又是日语的。。。  发表于 2012-4-10 15:50
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
9 小时
注册时间
2012-4-9
帖子
9
4
发表于 2012-4-11 19:08:36 | 只看该作者
  #--------------------------------------------------------------------------
  def terminate
    super
    dispose_menu_background
    @help_window.dispose
    @equip_window.dispose
    @status_window.dispose
    dispose_item_windows
  end
  #--------------------------------------------------------------------------
  # ● 回到原画面
  #--------------------------------------------------------------------------
  def return_scene
    $scene = Scene_Menu.new(2)
  end
  #--------------------------------------------------------------------------
  # ● 切换至下一角色画面
  #--------------------------------------------------------------------------
  def next_actor
    @actor_index += 1
    @actor_index %= $game_party.members.size
    $scene = Scene_Equip.new(@actor_index, @equip_window.index)
  end
  #--------------------------------------------------------------------------
  # ● 切换至上一角色画面
  #--------------------------------------------------------------------------
  def prev_actor
    @actor_index += $game_party.members.size - 1
    @actor_index %= $game_party.members.size
    $scene = Scene_Equip.new(@actor_index, @equip_window.index)
  end
  #--------------------------------------------------------------------------
  # ● 更新画面
  #--------------------------------------------------------------------------
  def update
    super
    update_menu_background
    @help_window.update
    update_equip_window
    update_status_window
    update_item_windows
    if @equip_window.active
      update_equip_selection
    elsif @item_window.active
      update_item_selection
    end
  end
  #--------------------------------------------------------------------------
  # ● 生成装备物品窗口
  #--------------------------------------------------------------------------
  def create_item_windows
    @item_windows = []
    for i in 0...EQUIP_TYPE_MAX
      @item_windows[i] = Window_EquipItem.new(0, 184, 544, 232, @actor, i)
      @item_windows[i].help_window = @help_window
      @item_windows[i].visible = (@equip_index == i)
      @item_windows[i].y = 232
      @item_windows[i].height = 184
      @item_windows[i].active = false
      @item_windows[i].index = -1
    end
  end
  #--------------------------------------------------------------------------
  # ● 释放装备物品窗口
  #--------------------------------------------------------------------------
  def dispose_item_windows
    for window in @item_windows
      window.dispose
    end
  end
  #--------------------------------------------------------------------------
  # ● 更新装备物品窗口
  #--------------------------------------------------------------------------
  def update_item_windows
    for i in 0...EQUIP_TYPE_MAX
      @item_windows[i].visible = (@equip_window.index == i)
      @item_windows[i].update
    end
    @item_window = @item_windows[@equip_window.index]
  end
  #--------------------------------------------------------------------------
  # ● 更新装备窗口
  #--------------------------------------------------------------------------
  def update_equip_window
    @equip_window.update
  end
  #--------------------------------------------------------------------------
  # ● 更新状态窗口
  #--------------------------------------------------------------------------
  def update_status_window
    if @equip_window.active
      @status_window.set_new_parameters(nil, nil, nil, nil, nil, nil, nil, nil)
    elsif @item_window.active
      temp_actor = @actor.clone
      temp_actor.change_equip(@equip_window.index, @item_window.item, true)
      new_atk = temp_actor.atk
      new_def = temp_actor.def
      new_spi = temp_actor.spi
      new_agi = temp_actor.agi
      new_mdef = temp_actor.mdef
      new_hit = temp_actor.hit
      new_eva = temp_actor.eva
      new_cri = temp_actor.cri
      @status_window.set_new_parameters(new_atk, new_def, new_spi, new_agi, new_mdef, new_hit, new_eva, new_cri)
    end
    @status_window.update
  end
  #--------------------------------------------------------------------------
  # ● 更新装备区域选择
  #--------------------------------------------------------------------------
  def update_equip_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      return_scene
    elsif Input.trigger?(Input::R)
      Sound.play_cursor
      next_actor
    elsif Input.trigger?(Input::L)
      Sound.play_cursor
      prev_actor
    elsif Input.trigger?(Input::C)
      if @actor.fix_equipment
        Sound.play_buzzer
      else
        Sound.play_decision
        @equip_window.active = false
        @item_window.active = true
        @item_window.index = 0
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 更新装备物品选择
  #--------------------------------------------------------------------------
  def update_item_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      @equip_window.active = true
      @item_window.active = false
      @item_window.index = -1
    elsif Input.trigger?(Input::C)
      Sound.play_equip
      @actor.change_equip(@equip_window.index, @item_window.item)
      @equip_window.active = true
      @item_window.active = false
      @item_window.index = -1
      @equip_window.refresh
      for item_window in @item_windows
        item_window.refresh
      end
    end
  end
end

#==============================================================================
# ■ Window_EquipStatus
#------------------------------------------------------------------------------
#  装备画面的、显示角色能力值变化的窗口。
#==============================================================================

class Window_EquipStatus < Window_Base
  #--------------------------------------------------------------------------
  # ● 初始化对像
  # ● 初始化对像
  #     x      : 窗口 X 座标
  #     y      : 窗口 Y 座标
  #     actor  : 角色
  #--------------------------------------------------------------------------
  def initialize(x, y, actor)
    super(x, y-58, 208, WLH * 9 + 18)
    @actor = actor
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    draw_actor_name(@actor, 4, -3)
    draw_parameter(0, WLH * 1, 0)
    draw_parameter(0, WLH * 2, 1)
    draw_parameter(0, WLH * 3, 2)
    draw_parameter(0, WLH * 4, 3)
    draw_parameter(0, WLH * 5, 4)
    draw_parameter(0, WLH * 6, 5)
    draw_parameter(0, WLH * 7, 6)
    draw_parameter(0, WLH * 8, 7)
  end
  #--------------------------------------------------------------------------
  # ● 设置装备後的能力值
  #     new_atk : 装备後的攻击力
  #     new_def : 装备後的防御力
  #     new_spi : 装备後的精神力
  #     new_agi : 装备後的敏捷
  #--------------------------------------------------------------------------
  def set_new_parameters(new_atk, new_def, new_spi, new_agi, new_mdef, new_hit, new_eva, new_cri)
    if @new_atk != new_atk or @new_def != new_def or
       @new_spi != new_spi or @new_agi != new_agi or
       @new_mdef != new_mdef or @new_hit != new_hit or
       @new_eva != new_eva or @new_cri != new_cri
      @new_atk = new_atk
      @new_def = new_def
      @new_spi = new_spi
      @new_agi = new_agi
      @new_mdef = new_mdef
      @new_hit = new_hit
      @new_eva = new_eva
      @new_cri = new_cri
      refresh
    end
  end
  #--------------------------------------------------------------------------
  # ● 获取装备後的能力值文字颜色
  #     old_value : 装备前的能力值
  #     new_value : 装备後的能力值
  #--------------------------------------------------------------------------
  def new_parameter_color(old_value, new_value)
    if new_value > old_value      # 增强
      return power_up_color
    elsif new_value == old_value  # 不变
      return normal_color
    else                          # 减弱
      return power_down_color
    end
  end
  #--------------------------------------------------------------------------
  # ● 绘制能力值
  #     x    : 绘制点 X 座标
  #     y    : 绘制点 Y 座标
  #     type : 能力值 (0:攻击力、1:防御力、2:精神力、3:敏捷)
  #--------------------------------------------------------------------------
  def draw_parameter(x, y, type)
    case type
    when 0
      name = Vocab::atk
      value = @actor.atk
      new_value = @new_atk
    when 1
      name = Vocab::def
      value = @actor.def
      new_value = @new_def
    when 2
      name = Vocab::spi
      value = @actor.spi
      new_value = @new_spi
    when 4
      name = Vocab::agi
      value = @actor.agi
      new_value = @new_agi
    when 3
      name = "魔防"
      value = @actor.mdef
      new_value = @new_mdef
    when 5
      name = "命中"
      value = @actor.hit
      new_value = @new_hit
    when 6
      name = "回避"
      value = @actor.eva
      new_value = @new_eva
    when 7
      name = "暴击"
      value = @actor.cri
      new_value = @new_cri
    end
    self.contents.font.color = system_color
    self.contents.draw_text(x + 4, y-10, 80, WLH, name)
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 90, y-10, 30, WLH, value, 2)
    self.contents.font.color = system_color
    self.contents.draw_text(x + 122, y-10, 20, WLH, ">", 1)
    if new_value != nil
      self.contents.font.color = new_parameter_color(value, new_value)
      self.contents.draw_text(x + 142, y-11, 30, WLH, new_value, 2)
    end
  end
end

#==============================================================================
# ■ Window_Equip
#------------------------------------------------------------------------------
#  装备画面、显示角色现在装备的物品的窗口。
#==============================================================================

class Window_Equip < Window_Selectable
  #--------------------------------------------------------------------------
  # ● 初始化对像
  #     x      : 窗口 X 座标
  #     y      : 窗口 Y 座标
  #     actor  : 角色
  #--------------------------------------------------------------------------
  def initialize(x, y, actor)
    super(x, y-58, 336, WLH * 9 + 18)
    @actor = actor
    refresh
    self.index = 0
  end
end
不知道是不
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-14 03:37

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表