查看: 1880|回复: 6

[已经过期] [已更改]更改读档界面透明度

[复制链接]
梦石
0
星屑
3905
在线时间
1972 小时
注册时间
2013-1-3
回帖
9146
发表于 2013-4-4 18:08:42 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 紫英晓狼1130 于 2013-4-5 05:44 编辑

希望大家告诉我:如何更改读档界面的透明度
这样是想让游戏的界面更美观

估计是游戏的问题,更改完无效
画面就像调了亮度,有些黑
改透明度也只是上方的Windowskin更改
问题4.png
当画面未经过刷新(当存档的“文件X”被更换)时,全是黑的
问题1.png
刷新后,又正常了,但只是下方的存档更改,“要载入哪个文件”的透明度一样
问题.png
所以说,这需要更改背景的黑色
改为透明的,再将“文件X”的透明度更改即可

[pre lang=""line="1"]#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================  
# --------------------------------------------------------------------  
# 本脚本来自www.66rpg.com,转载自www.phylomortis.com,转载请保留此信息
# --------------------------------------------------------------------
class Scene_File
  #——最大存档数量,一般我认为最多50足够了,20比较合适
  SAVEFILE_MAX = 50
  # -------------------
  def initialize(help_text)
    @help_text = help_text
  end
  # -------------------
  def main
    @help_window = Window_Help.new
    @help_window.set_text(@help_text)
    @help_window.opacity = 160
    @savefile_windows = []
    @cursor_displace = 0
    for i in 0..3
      @savefile_windows.push(Window_SaveFile.new(i, make_filename(i), i))
      @savefile_windows.opacity = 160
    end
    @file_index = 0
    @savefile_windows[@file_index].selected = true
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @help_window.dispose
    for i in @savefile_windows
      i.dispose
    end
  end
  # -------------------
  def update
    @help_window.update
    for i in @savefile_windows
      i.update
    end
    if Input.trigger?(Input::C)
      on_decision(make_filename(@file_index))
      $game_temp.last_file_index = @file_index
      return
    end
    if Input.trigger?(Input::B)
      on_cancel
      return
    end
    if Input.repeat?(Input::DOWN)
      if Input.trigger?(Input::DOWN) or @file_index < SAVEFILE_MAX - 1
        if @file_index == SAVEFILE_MAX - 1
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        @cursor_displace += 1
        if @cursor_displace == 4
          @cursor_displace = 3
          for i in @savefile_windows
            i.dispose
          end
          @savefile_windows = []
          for i in 0..3
            f = i - 1 + @file_index
            name = make_filename(f)
            @savefile_windows.push(Window_SaveFile.new(f, name, i))
            @savefile_windows.selected = false
          end
        end
        $game_system.se_play($data_system.cursor_se)
        @file_index = (@file_index + 1)
        if @file_index == SAVEFILE_MAX
          @file_index = SAVEFILE_MAX - 1
        end
        for i in 0..3
          @savefile_windows.selected = false
        end
        @savefile_windows[@cursor_displace].selected = true
        return
      end
    end
    if Input.repeat?(Input::UP)
      if Input.trigger?(Input::UP) or @file_index > 0
        if @file_index == 0
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        @cursor_displace -= 1
        if @cursor_displace == -1
          @cursor_displace = 0
          for i in @savefile_windows
            i.dispose
          end
          @savefile_windows = []
          for i in 0..3
            f = i - 1 + @file_index
            name = make_filename(f)
            @savefile_windows.push(Window_SaveFile.new(f, name, i))
            @savefile_windows.selected = false
          end
        end
        $game_system.se_play($data_system.cursor_se)
        @file_index = (@file_index - 1)
        if @file_index == -1
          @file_index = 0
        end
        for i in 0..3
          @savefile_windows.selected = false
          @help_window.opacity = 160
        end
        @savefile_windows[@cursor_displace].selected = true
        return
      end
    end
  end
  # -------------------
  def make_filename(file_index)
    return "Save/Save#{file_index + 1}.rxdata"
  end
  # -------------------
end
  

class Window_SaveFile < Window_Base
  # -------------------
  def initialize(file_index, filename, position)
    y = 63 + position * 139
    super(0, y, 640, 139)
    self.contents = Bitmap.new(width - 32, height - 32)
    @file_index = file_index
    @filename = "Save/Save#{@file_index + 1}.rxdata"
    @time_stamp = Time.at(0)
    @file_exist = FileTest.exist?(@filename)
    if @file_exist
      file = File.open(@filename, "r")
      @time_stamp = file.mtime
      @characters = Marshal.load(file)
      @frame_count = Marshal.load(file)
      @game_system = Marshal.load(file)
      @game_switches = Marshal.load(file)
      @game_variables = Marshal.load(file)
      @total_sec = @frame_count / Graphics.frame_rate
      file.close
    end
    refresh
    @selected = false
  end
end [/pre]
希望大家帮忙~
如果您没有时间,没关系,谢谢您~
如果您能回答的话,十分感谢您~
《宿愿·寻剑篇》正式版已经发布!快去看看!点击进入论坛发布贴

万兽

梦石
0
星屑
602
在线时间
2271 小时
注册时间
2006-11-4
回帖
4701

贵宾

发表于 2013-4-4 18:15:33 | 显示全部楼层
本帖最后由 弗雷德 于 2013-4-4 18:18 编辑

Scene_File下:
main里面:
一开头:
  1. # 生成帮助窗口
  2. @help_window = Window_Help.new
  3. @help_window.set_text(@help_text)
复制代码
改成:
透明度自己定
  1. # 生成帮助窗口
  2. @spriteset = Spriteset_Map.new
  3. @help_window = Window_Help.new
  4. @help_window.set_text(@help_text)
  5. @help_window.opacity = 100
复制代码
第24行左右:
有这么一段
  1. for i in 0..3
  2.       @savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))
  3.     end
复制代码
加中间加一句:
透明度自己定
  1.     for i in 0..3
  2.       @savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))
  3.       @savefile_windows[i].opacity = 100
  4.     end
复制代码
48行左右
  1. # 释放窗口
  2. @help_window.dispose
  3. for i in @savefile_windows
  4. i.dispose
  5. end
复制代码
加一句:
  1. # 释放窗口
  2. @help_window.dispose
  3. for i in @savefile_windows
  4. i.dispose
  5. end
  6. @spriteset.dispose
复制代码

点评

熊叔叔比我快啊  发表于 2013-4-4 18:18
谢谢熊叔~  发表于 2013-4-4 18:17

评分

参与人数 1星屑 +80 收起 理由
hcm + 80 感谢回答

查看全部评分

回复

使用道具 举报

梦石
20
星屑
1840
在线时间
6925 小时
注册时间
2012-12-14
回帖
10960

短篇十战斗者组别冠军开拓者贵宾短篇九勇士组亚军

发表于 2013-4-4 18:16:48 | 显示全部楼层
修改 Window_Help内的透明度和 Window_SaveFile的透明度
加入:self.back_opacity = 160

点评

刚好在逛XP提问区  发表于 2013-4-4 18:20
谢晨露  发表于 2013-4-4 18:18
大家好,这里是晨露的说。请多多指教。
刚入门RM软件制作,请大家多多帮助我哦。
落雪君的欢乐像素教程,欢迎查阅。

回复

使用道具 举报

万兽

梦石
0
星屑
602
在线时间
2271 小时
注册时间
2006-11-4
回帖
4701

贵宾

发表于 2013-4-4 18:19:20 | 显示全部楼层
刚刚漏写一段,又加了一句

点评

知道了~谢谢~  发表于 2013-4-4 18:20
回复

使用道具 举报

梦石
0
星屑
3905
在线时间
1972 小时
注册时间
2013-1-3
回帖
9146
 楼主| 发表于 2013-4-5 13:48:06 | 显示全部楼层
自己已经想了办法,还没法解决,好像界面被刷新了一样...

点评

错误那行改为@savefile_windows.push(Window_SaveFile.new(i, make_filename(i), i))  发表于 2013-4-5 15:33
《宿愿·寻剑篇》正式版已经发布!快去看看!点击进入论坛发布贴
回复

使用道具 举报

梦石
20
星屑
1840
在线时间
6925 小时
注册时间
2012-12-14
回帖
10960

短篇十战斗者组别冠军开拓者贵宾短篇九勇士组亚军

发表于 2013-4-5 13:54:10 | 显示全部楼层
范例一枚,不知道楼主改了什么地方
范例.zip (302.03 KB, 下载次数: 20)

点评

呼出存档画面就错了…  发表于 2013-4-5 15:30
修改Window_Help太鲁莽了,直接在Scene_File里修改@help_window.back_opacity就行了。  发表于 2013-4-5 14:08

评分

参与人数 1星屑 +50 收起 理由
hcm + 50 感谢回答

查看全部评分

大家好,这里是晨露的说。请多多指教。
刚入门RM软件制作,请大家多多帮助我哦。
落雪君的欢乐像素教程,欢迎查阅。

回复

使用道具 举报

万兽

梦石
0
星屑
602
在线时间
2271 小时
注册时间
2006-11-4
回帖
4701

贵宾

发表于 2013-4-5 21:40:22 | 显示全部楼层
晓狼能把你未改动过的脚本发上来么,目测你是没有添加这一句:@spriteset = Spriteset_Map.new,你再回头看看俺标注的几个地方。

点评

应该就是主楼的脚本  发表于 2013-4-6 03:47
看来是地图问题,我用了双远景地图  发表于 2013-4-6 03:46
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部