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

Project1

 找回密码
 注册会员
搜索

请问如何在“截图存取档”中显示章节名?

查看数: 2004 | 评论数: 8 | 收藏 0
关灯 | 提示:支持键盘翻页<-左 右->
    组图打开中,请稍候......
发布时间: 2010-8-10 12:23

正文摘要:

如题,如何在“截图存取档“界面中加入章节名的显示? 想做个章节游戏,求解! 如图,如何在红框处显示章节名? 原脚本如下:###使用说明 #使用前请复制sceneshot.dll到游戏文件下,并新建文件夹Save #将此文本插 ...

回复

退屈£无聊 发表于 2010-8-11 07:52:04
应该直接在游戏里用脚本指定$game_system.chapter = 就行了吧..
huyunchong 发表于 2010-8-10 20:27:29
额。。。
LS的脚本不知道怎么用哦。。
逸豫 发表于 2010-8-10 18:42:38
  1. class Game_System
  2.   attr :chapter,true
  3.   alias diyrpg_initialize initialize
  4.   def initialize
  5.     diyrpg_initialize
  6.     @chapter = ""
  7.   end
  8. end
  9. class Window_File < Window_Base
  10.   attr_accessor :index
  11.   def initialize(index = 0)
  12.     @backsp = Sprite.new
  13.    # @backsp.bitmap = Bitmap.new("Graphics/Pictures/菜单底图.jpg")
  14.     @backsp.z = 100
  15.     super(160,64,480,416)
  16.     #这行可以不用
  17.     self.contents = Bitmap.new(width - 32, height - 32)
  18.     @index = index
  19.     #这里我要说明一句,之所以用sprite是为了放缩图片
  20.     @sprite = Sprite.new
  21.     @sprite.visible = false
  22.     @sprite.z = 100
  23.     @sp_ch = []
  24.     @sp_ch[0] = Sprite.new
  25.     refresh
  26.   end
  27.   def refresh
  28.     self.contents.clear
  29.     for i in @sp_ch
  30.       i.visible = false
  31.     end
  32.     @sprite.visible = false
  33.     if FileTest.exist?(DIR+"Save#{@index}.rxdata")
  34.       @sprite.visible = true
  35.       if FileTest.exist?(DIR+"Save#{@index}.jpg")
  36.         @sprite.bitmap = Bitmap.new(DIR+"Save#{@index}.jpg")
  37.       else
  38.         self.contents.draw_text(32,64,400,32,"截图似乎有点问题……您搞什么了您?")
  39.       end
  40.       @sprite.x = 290
  41.       @sprite.y = 96
  42.       @sprite.z = 998
  43.       @sprite.zoom_x = 0.5
  44.       @sprite.zoom_y = 0.5
  45.       file = File.open(DIR+"Save#{@index}.rxdata", "r")
  46.       @time_stamp = file.mtime
  47.       @characters = Marshal.load(file)
  48.       @frame_count = Marshal.load(file)
  49.       @game_system = Marshal.load(file)
  50.       @game_switches = Marshal.load(file)
  51.       @game_variables = Marshal.load(file)
  52.       @total_sec = @frame_count / Graphics.frame_rate
  53.       file.close
  54.       for i in [email protected]
  55.         @sp_ch[i] = Sprite.new
  56.         @sp_ch[i].visible = true
  57.         testname = @characters[i][2].name+"_f"
  58.         @sp_ch[i].bitmap = Bitmap.new("Graphics/battlers/#{testname}")
  59.         @sp_ch[i].zoom_x = 0.8
  60.         @sp_ch[i].zoom_y = 0.8
  61.         @sp_ch[i].x = 180        
  62.         @sp_ch[i].y = 96 + i*90
  63.         @sp_ch[i].z = 101
  64.       end
  65.       # 描绘游戏时间
  66.       hour = @total_sec / 60 / 60
  67.       min = @total_sec / 60 % 60
  68.       sec = @total_sec % 60
  69.       time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
  70.       self.contents.font.color = normal_color
  71.       self.contents.draw_text(4, 326, 420, 32, time_string, 2)
  72.       self.contents.draw_text(4,390-32,420,32,@game_system.chapter,2)
  73.       # 描绘时间标记
  74.       self.contents.font.color = normal_color
  75.       time_string = @time_stamp.strftime("%Y/%m/%d %H:%M")
  76.       self.contents.draw_text(4, 356, 420, 32, time_string, 2)
  77.     else
  78.       self.contents.draw_text(32,32,420,32,"这个存档是空的")
  79.     end

  80.   end
  81.   def dispose
  82.     super
  83.     @sprite.dispose
  84.     @backsp.dispose
  85.     for i in @sp_ch
  86.       i.dispose
  87.     end
  88.   end
  89. end


  90. class Window_File2 < Window_Base
  91.   attr_accessor :index
  92.   def initialize(index = 0)
  93.     @backsp = Sprite.new
  94.    # @backsp.bitmap = Bitmap.new("Graphics/Pictures/菜单底图.jpg")
  95.     @backsp.z = 100
  96.     super(160,0,480,480)
  97.     #这行可以不用
  98.     self.contents = Bitmap.new(width - 32, height - 32)
  99.     @index = index
  100.     #这里我要说明一句,之所以用sprite是为了放缩图片
  101.     @sprite = Sprite.new
  102.     @sprite.visible = false
  103.     @sprite.z = 100
  104.     @sp_ch = []
  105.     @sp_ch[0] = Sprite.new
  106.     refresh
  107.   end
  108.   def refresh
  109.     self.contents.clear
  110.     for i in @sp_ch
  111.       i.visible = false
  112.     end
  113.     @sprite.visible = false
  114.     if FileTest.exist?(DIR+"Save#{@index}.rxdata")
  115.       @sprite.visible = true
  116.       if FileTest.exist?(DIR+"Save#{@index}.jpg")
  117.         @sprite.bitmap = Bitmap.new(DIR+"Save#{@index}.jpg")
  118.       else
  119.         self.contents.draw_text(32,64,400,32,"截图似乎有点问题……您搞什么了您?

  120. ")
  121.       end
  122.       @sprite.x = 290
  123.       @sprite.y = 32
  124.       @sprite.z = 998
  125.       @sprite.zoom_x = 0.5
  126.       @sprite.zoom_y = 0.5
  127.       file = File.open(DIR+"Save#{@index}.rxdata", "r")
  128.       @time_stamp = file.mtime
  129.       @characters = Marshal.load(file)
  130.       @frame_count = Marshal.load(file)
  131.       @game_system = Marshal.load(file)
  132.       @game_switches = Marshal.load(file)
  133.       @game_variables = Marshal.load(file)
  134.       @total_sec = @frame_count / Graphics.frame_rate
  135.       file.close
  136.       for i in [email protected]
  137.         @sp_ch[i] = Sprite.new
  138.         @sp_ch[i].visible = true
  139.         testname = @characters[i][2].name+"_f"
  140.         @sp_ch[i].bitmap = Bitmap.new("Graphics/battlers/#{testname}")
  141.         @sp_ch[i].x = 180        
  142.         @sp_ch[i].y = 32 + i*110
  143.         @sp_ch[i].z = 101
  144.       end
  145.       # 描绘游戏时间
  146.       hour = @total_sec / 60 / 60
  147.       min = @total_sec / 60 % 60
  148.       sec = @total_sec % 60
  149.       time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
  150.       self.contents.font.color = normal_color
  151.       self.contents.draw_text(4, 390, 420, 32, time_string, 2)
  152.       self.contents.draw_text(4,390-32,420,32,@game_system.chapter,2)
  153.       # 描绘时间标记
  154.       self.contents.font.color = normal_color
  155.       time_string = @time_stamp.strftime("%Y/%m/%d %H:%M")
  156.       self.contents.draw_text(4, 420, 420, 32, time_string, 2)
  157.     else
  158.       self.contents.draw_text(32,32,420,32,"这个存档是空的")
  159.     end

  160.   end
  161.   def dispose
  162.     super
  163.     @sprite.dispose
  164.     @backsp.dispose
  165.     for i in @sp_ch
  166.       i.dispose
  167.     end
  168.   end
  169. end


复制代码
修改章节名:$game_system.chapter="章节名称"

评分

参与人数 1星屑 +240 收起 理由
六祈 + 240 认可答案

查看全部评分

退屈£无聊 发表于 2010-8-10 17:56:29
根据变量判断..
在游戏到某处时加上变量1……
脚本中进行IF判断
如果变量= 某,显示某字
我什么都不知道别看着我。。。我不说了。。
huyunchong 发表于 2010-8-10 15:47:50
轻顶,没人回答吗???
zhixin1997 发表于 2010-8-10 13:42:05
- -其实LZ完全可以参考一下别的集成脚本
huyunchong 发表于 2010-8-10 13:37:00
那么具体要写什么呢?
本人脚本忙,谢谢了。
hongqizhen 发表于 2010-8-10 12:32:29
提示: 作者被禁止或删除 内容自动屏蔽
拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

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

GMT+8, 2025-4-7 18:16

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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