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

Project1

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

[已经解决] 请优化一下这个工程的标题脚本,谢谢。

[复制链接]

Lv5.捕梦者 (版主)

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

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

跳转到指定楼层
1
发表于 2013-4-25 18:26:20 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 美丽晨露 于 2013-4-26 18:21 编辑

感觉附带一些外部文件使用起来很不方便。
可以将这个功能优化掉,使不用这些外部文件也能使用这种
标题,可以做到吗?

范例一枚:

多图片菜单.zip (992.59 KB, 下载次数: 43)

点评

什么时候回复需要审理了= =  发表于 2013-4-25 20:19
找到了,"方正粗活意简体“,请安装这一字体,并告知用户安装这一字体,或者使用”加载外部字体“脚本  发表于 2013-4-25 19:21
这个标题是朋友给我做的,具体什么字体还真不明白  发表于 2013-4-25 19:03
标题是什么字体??  发表于 2013-4-25 18:55
大家好,这里是晨露的说。请多多指教。
刚入门RM软件制作,请大家多多帮助我哦。
落雪君的欢乐像素教程,欢迎查阅。

Lv5.捕梦者 (版主)

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

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

2
 楼主| 发表于 2013-4-26 17:44:35 | 只看该作者
@沙漠点灰

无法回复吗?能不能通过短消息将工程发给我呢?

点评

十分感谢  发表于 2013-4-26 18:21
没办法回复...上传到了网盘http://pan.baidu.com/share/link?shareid=582643&uk=4228885365  发表于 2013-4-26 18:02
大家好,这里是晨露的说。请多多指教。
刚入门RM软件制作,请大家多多帮助我哦。
落雪君的欢乐像素教程,欢迎查阅。

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
55
在线时间
323 小时
注册时间
2010-8-21
帖子
666
3
发表于 2013-4-26 18:00:42 | 只看该作者
再试试,可删除

健康游戏忠告
4个选项
作者

可搜索相应文字进行修改
  1. #==============================================================================
  2. # ■ Scene_Title
  3. #------------------------------------------------------------------------------
  4. #  处理标题画面的类。
  5. #==============================================================================
  6. class Rect
  7.   def include?(ary)
  8.     return false if !ary.is_a?(Array) || ary.size != 2
  9.     ary[0] >= self.x && ary[1] >= self.y && ary[0] < self.x + self.width &&
  10.     ary[1] < self.y + self.height
  11.   end
  12. end
  13. class Scene_Title
  14.   TITLE_SIZE = 4
  15.   TITLE_RECT = Rect.new(0,280, 292, 32)
  16.   @@title_rect = []
  17.   TITLE_SIZE.times{|i|@@title_rect << TITLE_RECT.dup;@@title_rect[-1].y += TITLE_RECT.height*i}
  18.   def initialize(skip = false)
  19.     @skip = skip
  20.   end
  21.   #--------------------------------------------------------------------------
  22.   # ● 主处理
  23.   #--------------------------------------------------------------------------
  24.   def main
  25.     # 战斗测试的情况下
  26.     if $BTEST
  27.       battle_test
  28.       return
  29.     end
  30.     # 载入数据库
  31.     $data_actors        = load_data("Data/Actors.rxdata")
  32.     $data_classes       = load_data("Data/Classes.rxdata")
  33.     $data_skills        = load_data("Data/Skills.rxdata")
  34.     $data_items         = load_data("Data/Items.rxdata")
  35.     $data_weapons       = load_data("Data/Weapons.rxdata")
  36.     $data_armors        = load_data("Data/Armors.rxdata")
  37.     $data_enemies       = load_data("Data/Enemies.rxdata")
  38.     $data_troops        = load_data("Data/Troops.rxdata")
  39.     $data_states        = load_data("Data/States.rxdata")
  40.     $data_animations    = load_data("Data/Animations.rxdata")
  41.     $data_tilesets      = load_data("Data/Tilesets.rxdata")
  42.     $data_common_events = load_data("Data/CommonEvents.rxdata")
  43.     $data_system        = load_data("Data/System.rxdata")
  44.     $data_mapnames      = load_data("Data/MapInfos.rxdata")
  45.     $game_system        = Game_System.new
  46.     @wait_count = 0
  47.     @index      = 0
  48.     # 判定继续的有效性
  49.     # 存档文件一个也不存在的时候也调查
  50.     # 有効为 @continue_enabled 为 true、無効为 false
  51.     @continue_enabled = false
  52.     for i in 0..3
  53.       if FileTest.exist?("Save#{i+1}.rxdata")
  54.         @continue_enabled = true
  55.       end
  56.     end
  57.     if @skip
  58.       acting(4)
  59.     else
  60.       start
  61.     end
  62.     # 停止演奏 ME、BGS
  63.     Audio.me_stop
  64.     Audio.bgs_stop
  65.     # 执行过渡
  66.     Graphics.transition
  67.     # 主循环
  68.     loop do
  69.       # 刷新游戏画面
  70.       Graphics.update
  71.       # 刷新输入信息
  72.       Input.update
  73.       # 刷新画面
  74.       update
  75.       # 如果画面被切换就中断循环
  76.       if $scene != self
  77.         break
  78.       end
  79.     end
  80.     # 装备过渡
  81.     Graphics.freeze
  82.     5.times do |i|@pic[i].bitmap.dispose; @pic[i].dispose end
  83.     @chooser.dispose
  84.     #@chooser.bitmap.dispose
  85.     Quarcy::Cache.clear
  86.   end
  87.   #--------------------------------------------------------------------------
  88.   # ● 刷新鼠标
  89.   #--------------------------------------------------------------------------
  90.   def update_mouse
  91.     pos = Mouse.get_mouse_pos
  92.     @@title_rect.each_with_index{|rect, index|return refresh_index(index)if rect.include?(pos)}
  93.   end
  94.   #--------------------------------------------------------------------------
  95.   # ● 刷新光标
  96.   #--------------------------------------------------------------------------
  97.   def refresh_index(index=@index)
  98.     return if @index == index
  99.     refresh_index!(index)
  100.     $game_system.se_play($data_system.cursor_se)
  101.   end
  102.   #--------------------------------------------------------------------------
  103.   # ● 刷新光标!
  104.   #--------------------------------------------------------------------------
  105.   def refresh_index!(index)
  106.     @index = index
  107.     @chooser.y = @@title_rect[@index].y
  108.   end
  109.   #--------------------------------------------------------------------------
  110.   # ● 刷新画面
  111.   #--------------------------------------------------------------------------
  112.   def update
  113.     @chooser.opacity = @pic[3].opacity if @pic.is_a?(Array)
  114.     return @wait_count -= 1 if @wait_count > 0
  115.     return if acting(@step)
  116.     update_mouse
  117.     return refresh_index((@index - 1)%TITLE_SIZE) if Input.repeat?(Input::UP) || Input.trigger?(Input::UP)
  118.     return refresh_index((@index + 1)%TITLE_SIZE) if Input.repeat?(Input::DOWN) || Input.trigger?(Input::DOWN)
  119.     # 按下 C 键的情况下
  120.     if Input.trigger?(Input::C)
  121.       # 命令窗口的光标位置的分支
  122.       case @index
  123.       when 0  # 新游戏
  124.         command_new_game
  125.       when 1  # 继续
  126.         command_continue
  127.       when 2 # 制作人员
  128.         $scene = Scene_Reference.new
  129.       when 3  # 退出
  130.         command_shutdown
  131.       end
  132.     end
  133.   end
  134.   #----------------------------------------------------------------------------
  135.   def start
  136.     @wait_count = 20
  137.     @step = 1
  138.   end
  139.   def acting(step)
  140.     case step
  141.     when 8
  142.       return false
  143.     when 1
  144.       @pic = Sprite.new
  145.       @pic.bitmap = make_logo
  146.       @pic.opacity = 0
  147.       @duration = 20
  148.       @step = 2
  149.       return true
  150.     when 2
  151.       if @duration > 0
  152.         d = @duration
  153.         @pic.opacity = (@pic.opacity * (d - 1) + 255) / d
  154.         @duration -= 1
  155.       else
  156.         @step = 3
  157.         @wait_count = 60
  158.         @duration   = 20
  159.       end
  160.       return true
  161.     when 3
  162.       if @duration > 0
  163.         d = @duration
  164.         @pic.opacity = (@pic.opacity * (d - 1) + 0) / d
  165.         @duration -= 1
  166.       else
  167.         @step = 4
  168.         @wait_count = 25
  169.       end
  170.       return true
  171.     when 4
  172.       if @pic !=nil
  173.         @pic.bitmap.dispose
  174.         @pic.dispose
  175.       end
  176.       @wait_count = 20
  177.       @duration   = 60
  178.       $game_system.bgm_play($data_system.title_bgm)
  179.       @pic = []
  180.       5.times do @pic << Sprite.new end
  181.       i = rand(3) + 1
  182.       @pic[0].bitmap = loadbitmap("Graphics/Title/背景#{i}")
  183.       @pic[1].bitmap = loadbitmap("Graphics/Title/LOGO")
  184.       actor = %w[莉德露一 莉德露二 莉德露三][rand(3)]
  185.       @pic[2].bitmap = loadbitmap("Graphics/Title/#{actor}")
  186.       @pic[3].bitmap = make_title
  187.       @chooser = Sprite.new
  188.       @chooser.z = @pic[3].z + 10
  189.       @chooser.bitmap = make_chooser
  190.       @chooser.opacity = 0
  191.       refresh_index!(@continue_enabled ? 1 : 0)
  192.       @pic[3].x = -15
  193.       @pic[3].y = 280
  194.       @pic[4].bitmap = make_author#loadbitmap("Graphics/Title/66RPG")
  195.       @pic[4].y = 460
  196.       5.times do |i|@pic[i].opacity = 0 end
  197.       @step = 5
  198.       return true
  199.     when 5
  200.       if @duration > 40
  201.         d = @duration - 40
  202.         @pic[0].opacity = (@pic[0].opacity * (d - 1) + 255) / d
  203.         @pic[4].opacity = (@pic[3].opacity * (d - 1) + 255) / d
  204.         @duration -= 1
  205.         return true
  206.       elsif @duration > 25
  207.         d = @duration - 25
  208.         @pic[1].opacity = (@pic[1].opacity * (d - 1) + 255) / d
  209.         @pic[2].opacity = (@pic[2].opacity * (d - 1) + 255) / d
  210.         @duration -= 1
  211.         return true
  212.       elsif @duration > 0
  213.         d = @duration
  214.         @pic[3].opacity = (@pic[3].opacity * (d - 1) + 255) / d
  215.         @duration -= 1
  216.         return true
  217.       else
  218.         @step = 8
  219.         @wait_count = 3
  220.       end
  221.       return true
  222.     when 6
  223.       if @duration > 0
  224.         d = @duration
  225.         @pic[0].opacity = (@pic[0].opacity * (d - 1) + 0) / d
  226.         @duration -= 1
  227.       else
  228.         @step = 7
  229.         @duration = 20
  230.         @pic[0].x = 0
  231.       end
  232.       return true
  233.     when 7
  234.       if @duration > 0
  235.         d = @duration
  236.         @pic[0].opacity = (@pic[0].opacity * (d - 1) + 255) / d
  237.         @duration -= 1
  238.       else
  239.         @step = 8
  240.       end
  241.     else
  242.       return true
  243.     end
  244.       
  245.   end
  246.   #--------------------------------------------------------------------------
  247.   # ● 生成光标
  248.   #--------------------------------------------------------------------------
  249.   def make_chooser
  250.     bmp = Bitmap.new(TITLE_RECT.width, TITLE_RECT.height)
  251.     bmp.fill_rect(bmp.rect, Color.new(255, 248,168, 128))
  252.     bmp.fill_rect(2,2,bmp.width-4,bmp.height-8,Color.new(251, 229,151, 128))
  253.     5.times{|i|bmp.fill_rect(0,bmp.height-i,bmp.width,1,Color.new(0, 0,0, 16*(i+1)))}
  254.     4.times{|i|bmp.fill_rect(bmp.width-i,0,1,bmp.height,Color.new(0, 0,0, 16*(i+1)))}
  255.     bmp
  256.   end
  257.   #--------------------------------------------------------------------------
  258.   # ● 載入圖片并放置于緩存區
  259.   #--------------------------------------------------------------------------
  260.   def loadbitmap(path)
  261.     return Quarcy::Cache.loadbitmap(path)
  262.   end
  263.   #--------------------------------------------------------------------------
  264.   # ● 生成标题cmd
  265.   #--------------------------------------------------------------------------
  266.   def make_title
  267.     text = ["新的开始", "继续旅程", "制作名单", "离开游戏"]
  268.     bmp = Bitmap.new(TITLE_RECT.width, TITLE_RECT.height * TITLE_SIZE)
  269.     bmp.font.name = ["方正粗活意简体", "楷体"]
  270.     tx = 64
  271.     text.each_with_index{|s,i|
  272.       tmp_x = tx + i * 32
  273.       s.split(//).each{|char|
  274.         bmp.font.size = 32
  275.         bmp.font.color = Color.new(0,0,0,100)
  276.         bmp.font.bold = true
  277.         t_r = bmp.text_size(char)
  278.         bmp.draw_text(tmp_x+2,TITLE_RECT.height*i+3,t_r.width,t_r.height,char,1)
  279.         bmp.font.color = Color.new(255,255,255)
  280.         bmp.draw_text(tmp_x,TITLE_RECT.height*i,t_r.width,t_r.height,char,1)
  281.         bmp.font.size = 28
  282.         bmp.font.color = Color.new(0,0,0)
  283.         bmp.font.bold = false
  284.         t2_r = bmp.text_size(char)
  285.         t2_r.x += tmp_x + (t_r.width-t2_r.width)/2
  286.         t2_r.y += TITLE_RECT.height*i + (t_r.height-t2_r.height)/2
  287.         bmp.draw_text(t2_r,char,1)
  288.         tmp_x += t_r.width
  289.       }
  290.     }
  291.     bmp.font.color = Color.new(0,0,0,128)
  292.     bmp
  293.   end
  294.   #--------------------------------------------------------------------------
  295.   # ● 生成作者
  296.   #--------------------------------------------------------------------------
  297.   def make_author
  298.     bmp = Bitmap.new(22*7, 32)
  299.     bmp.font.name = "宋体"
  300.     bmp.draw_text(bmp.rect, "作者: 美丽晨露", 1)
  301.     bmp
  302.   end
  303.   #--------------------------------------------------------------------------
  304.   # ● 生成logo
  305.   #--------------------------------------------------------------------------
  306.   def make_logo
  307.     bmp = Bitmap.new(640, 480)
  308.     bmp.font.size = 26
  309.     bmp.draw_text(0,96,640,32, "健康游戏公告", 1)
  310.     con = ["抵制不良游戏,拒绝盗版游戏。", "注意自我保护,谨防受骗上当。",
  311.            "适度游戏益脑,沉迷游戏伤身。", "合理安排时间,享受健康生活。"]
  312.     bmp.font.size = 22
  313.     con.each_with_index{|s,i| bmp.draw_text(0,166+i*38,640,32, s, 1)}
  314.     bmp
  315.   end
  316. end
  317. class Scene_Reference
  318.   #--------------------------------------------------------------------------
  319.   # ● 主处理
  320.   #--------------------------------------------------------------------------
  321.   def main
  322.     bg_sprite = Sprite.new()
  323.     bg_sprite.bitmap = Quarcy::Cache.loadbitmap("Graphics/Pictures/制作人员")
  324.     # 执行过渡
  325.     Graphics.transition(20, "Graphics/Transitions/标题过度.png")
  326.     # 主循环
  327.     loop do
  328.       # 刷新游戏画面
  329.       Graphics.update
  330.       # 刷新输入信息
  331.       Input.update
  332.       if Input.trigger?(Input::C) or Input.trigger?(Input::B)
  333.         $game_system.se_play($data_system.decision_se)
  334.         $scene = Scene_Title.new(true)
  335.       end
  336.       # 如果画面被切换就中断循环
  337.       if $scene != self
  338.         break
  339.       end
  340.     end
  341.     bg_sprite.dispose()
  342.     # 准备过渡
  343.     Graphics.freeze
  344.     Quarcy::Cache.clear
  345.   end
  346. end
复制代码

评分

参与人数 1星屑 +200 收起 理由
hcm + 200 认可答案

查看全部评分

>>猛戳>>MetalSagaR游戏主页<<这里<<
欢迎提供您的意见
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-4 03:04

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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