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

Project1

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

[已经解决] 外站腳本的使用問題

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
49 小时
注册时间
2012-6-16
帖子
5
跳转到指定楼层
1
 楼主| 发表于 2013-2-3 02:04:37 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
这个脚本的功能是创造一个显示游戏完成度的窗口
我想把那个窗口放在菜单的选项栏下方
要怎样实现呢?
万分感谢
RUBY 代码复制
  1. #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  2. # ■ Window_GameCompletion [RMVXace]
  3. # ■ Author: Bigace360
  4. # ■ Version: 1.0
  5. # ■ Date: 5.25.2012
  6. # Home Blog: [url]http://bigaceworld.wordpress.com/[/url]
  7. #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  8. #                                INTRODUCTION                                  #
  9. #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  10. #  Shows how much percentage of the game is completed by calling how much a
  11. #  variable is.
  12. #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  13. #                                INSTRUCTIONS                                  #
  14. #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  15. # In the Event Editor, under the Control Variable tab, set the variable to the
  16. # number you have in the module below. Then have the Operation at Set and then,
  17. # change the constant to whatever number you want to add between 1~100.
  18. #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  19. module ACE
  20.         module Completion
  21.                 #The set game_variable
  22.                 PROGRESS_VARIABLE = 1
  23.           # The way progress percentage will be displayed.
  24.                 COMPLETE_PERCENT  = "%1.0f%%"   
  25.                 #Name of the window
  26.                 HEADER            = 'Game Completion'
  27.                 #Colors for the bar
  28.                 PRG_COLOR1 = Color.new(150, 0, 0, 255)
  29.                 PRG_COLOR2 = Color.new(255, 255, 60, 255)
  30.                 #Color for a 100% game completion bar
  31.                 FULL_COLOR = Color.new(0, 255, 0, 255)
  32.         end
  33. end
  34. class Window_Progress < Window_Base
  35.         include ACE::Completion
  36.         attr_reader   :progress   # PROGRESS
  37.         def initialize
  38.                 super
  39.     Window_Base.new(0, 0, window_width, fitting_height(2))
  40.                 @progress = 0
  41.                 refresh
  42.         end
  43.         def window_width;  return 160;                                     end         
  44.         def progres_v;     return $game_variables[PROGRESS_VARIABLE];      end
  45.         def complete_rate; progres_v > 0 ? @progress.to_f / progres_v : 0; end
  46.         def refresh
  47.                 contents.clear
  48.                 draw_completion_bar(x, y, progress)
  49.         end
  50.   def draw_gauge(dx, dy, dw, rate, color1, color2)
  51.                 dw += 2 if true
  52.                 fill_w = dw * progres_v / [100, 1].max
  53.                 gauge_h = 12
  54.                 gauge_y = dy + 24
  55.                 if true
  56.                         outline_colour = gauge_back_color
  57.                         outline_colour.alpha = translucent_alpha
  58.                         self.contents.fill_rect(dx, gauge_y, dw, gauge_h, outline_colour)
  59.                         dx += 1
  60.                 end
  61.                 self.contents.fill_rect(dx, gauge_y, dw, gauge_h, outline_colour)
  62.                 contents.gradient_fill_rect(dx, gauge_y, fill_w, gauge_h, color1, color2)
  63.   end
  64.         def draw_completion_bar(x, y, progress, width = 120)
  65.                 draw_gauge(x+5, y+10, width, complete_rate, PRG_COLOR1, PRG_COLOR2)
  66.                 if progres_v == 100
  67.                         draw_gauge(x+5, y+10, width, complete_rate, FULL_COLOR, FULL_COLOR)
  68.                 end
  69.                 change_color(system_color)
  70.                 draw_text(x, y-6, window_width-32, 32, HEADER, 1)
  71.                 change_color(normal_color)
  72.                 xr = x + width
  73.                 if @progress == 0
  74.                         text = sprintf(COMPLETE_PERCENT, progres_v)
  75.                 else
  76.       text = sprintf(COMPLETE_PERCENT, @progress.to_i * 100 / 100)
  77.     end
  78.     draw_text(x+10, y+15, width, 32, text, 2)
  79.         end
  80. end

Lv1.梦旅人

梦石
0
星屑
50
在线时间
687 小时
注册时间
2012-10-29
帖子
1543
2
发表于 2013-2-3 09:28:18 | 只看该作者
本帖最后由 j433463 于 2013-2-3 09:32 编辑

这一段直接贴到您那国外脚本的最底下即可:
  1. #==============================================================================
  2. # ■ Window_Completion
  3. #------------------------------------------------------------------------------
  4. #  显示完成度的视窗
  5. #==============================================================================

  6. class Window_Completion < Window_Base
  7.   #--------------------------------------------------------------------------
  8.   # ● 初始化物件
  9.   #--------------------------------------------------------------------------
  10.   def initialize
  11.     super(0, 0, window_width, fitting_height(1))
  12.     @prestige = "完成" #单位名,不喜欢自己改
  13.     refresh
  14.   end
  15.   #--------------------------------------------------------------------------
  16.   # ● 取得视窗的宽度
  17.   #--------------------------------------------------------------------------
  18.   def window_width
  19.     return 160
  20.   end
  21.   #--------------------------------------------------------------------------
  22.   # ● 重新整理
  23.   #--------------------------------------------------------------------------
  24.   def refresh
  25.     contents.clear
  26.     cx = text_size(@prestige).width
  27.     change_color(normal_color)
  28.     draw_text(x, y, contents_width - cx - 6, line_height, $game_variables[1], 2) #描绘完成值,如果不是用1号变量,自己改 1 的值
  29.     change_color(system_color)
  30.     draw_text(x, y, contents_width - 4, line_height, @prestige, 2) #描绘单位名,这个不必动它
  31.   end
  32.   #--------------------------------------------------------------------------
  33.   # ● 开启视窗
  34.   #--------------------------------------------------------------------------
  35.   def open
  36.     refresh
  37.     super
  38.   end
  39. end
  40. class Scene_Menu < Scene_MenuBase
  41.   #--------------------------------------------------------------------------
  42.   # ● 生成金钱窗口
  43.   #--------------------------------------------------------------------------
  44.   alias create_completion_window create_gold_window
  45.   def create_gold_window
  46.     create_completion_window
  47.     @completion_window = Window_Completion.new
  48.     @completion_window.x = 0
  49.     @completion_window.y =  Graphics.height - @completion_window.height * 2 #窗口位置高度改这儿
  50.   end
  51. end
复制代码

评分

参与人数 1梦石 +1 收起 理由
Mic_洛洛 + 1 认可答案

查看全部评分

修改劇本中,仔細審查原來的劇情大綱,覺得有點不太滿意,嘗試編寫不同主角不同主線的劇情,希望能寫得出來。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
49 小时
注册时间
2012-6-16
帖子
5
3
 楼主| 发表于 2013-2-3 12:35:08 | 只看该作者
本帖最后由 reguna 于 2013-2-3 15:57 编辑

谢谢你的回答
可是这外站脚本做出的效果应该是这样子



能不能做到这样呢?
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-17 01:27

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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