搜索附件  
同能RPG制作大师 附件中心 同能RM技术讨论区 RPG Maker XP 讨论区 【加工】行走图转换器(VA/VX -> XP): Char_Va2XP.7z

【加工】行走图转换器(VA/VX -> XP): Char_Va2XP.7z

 

【加工】行走图转换器(VA/VX -> XP):
之前写过一个脚本可以直接在XP上使用VA/VX的单个行走图,这个脚本用起来还凑合,主要的问题就是VX/VA的行走图有很多是8个人放在一张图上的,放到XP里面还得先裁剪。即便是单张4×3的行走图,在编辑器中显示也是怪怪的。最近锅盖要办什么事件剧情设计大赛,需要把VA行走图搞的XP上,于是就写了这个脚本。
用法十分简单,脚本里面已经附上说明。
RUBY 代码
[code]#=========================================================================
# 行走图转换工具 VA->XP Ver 1.0
#-------------------------------------------------------------------------
# @Author : RyanBern
#-------------------------------------------------------------------------
# 用法:
#   将待转换的 VA 行走图放入工程根目录的 vx_chara_s 文件夹下,并新建一个
#   文件夹 xp_chara_s 用于存放转换好的 XP 行走图。新的行走图文件名会命名
#   为 原行走图_00~原行走图_07.png,必要时请设置横向和纵向格栅数。
#   然后将此脚本插入到 Main 组之前,运行游戏工程,在标题画面按下 Z 键即可
#   进行批量转换。使用完毕后,可以将此脚本删除(附带的MGC_PNG.dll如果用不
#   到也可以删掉)
#=========================================================================
module Char_VA2XP
  # VA 行走图文件夹(输入)
  Dir_In  = "vx_chara_s"

  # XP 行走图文件夹(输出)
  Dir_Out = "xp_chara_s"

  # 横向格栅数(即一张图横向有多少个角色)
  NUMS_X = 4

  # 纵向格栅数(即一张图纵向有多少个角色)
  NUMS_Y = 2

  defself.start_covert
    $scene = Scene_Char_Convert
  end
  class Window_Progress < ::Window_Base
    def initialize
      super(0, 0, 288, 96)
      @curr = @tol = 0
      self.contents = Bitmap.new(width - 32, height - 32)
      self.x = 320 - width / 2
      self.y = 240 - height / 2
      self.opacity = 0
      refresh
    end
    def refresh
      self.contents.clear
      refresh_words
      refresh_progress
    end
    def refresh_words
      self.contents.draw_text(4, 0, width - 36, 32, "Converting...Please wait...")
    end
    def refresh_progress
      self.contents.fill_rect(0, 32, width - 32, 32, Color.new(0, 0, 0, 0))
      self.contents.draw_text(96, 32, 48, 32, @curr.to_s, 2)
      self.contents.draw_text(144, 32, 24, 32, "/", 1)
      self.contents.draw_text(168, 32, 48, 32, @tol.to_s)
    end
    def set(curr, tol)
      if@curr != curr || @tol != tol
        @curr, @tol = curr, tol
        refresh_progress
      end
    end
  end
  class Scene_Char_Convert
    def main
      @progress_window = Window_Progress.new
      Graphics.transition
      start_convert
      Graphics.freeze
      @progress_window.dispose
      print"done"
      exit
    end
    def start_convert
      filenames_in = []
      unlessFileTest.exist?(Dir_Out)
        Dir.mkdir(Dir_Out)
      end
      Dir.foreach(Dir_In)do |s|
        filenames_in

QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

GMT+8, 2024-9-21 10:48 , Processed in 0.055683 second(s), 17 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

返回顶部