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

Project1

 找回密码
 注册会员
搜索
楼主: 冰舞蝶恋

[已经解决] 关于选项指令窗口描边、去框、文字色

[复制链接]

Lv2.观梦者

花开堪折直须折

梦石
0
星屑
611
在线时间
943 小时
注册时间
2010-7-17
帖子
4963

贵宾

 楼主| 发表于 2010-11-2 21:51:24 | 显示全部楼层
回复 Rion幻音 的帖子

水镜的只有系统选框才这样,就连装备啥的选项也没有文字描边啊!我还想要文章选项描边>.<!
大家好,我叫节操,有一天,我被吃了。
http://forever-dream.5d6d.com
永恒の梦制作组论坛

129993099
永恒の梦制作组QQ群
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
65
在线时间
433 小时
注册时间
2007-5-1
帖子
993
发表于 2010-11-2 22:03:52 | 显示全部楼层
Window.png

红圈部分删掉就去框了,至于全选项描边,先放几天看看有没有好人出现吧。

点评

……你到底想保留哪些选框,去掉哪些选框?  发表于 2010-11-2 22:33
把那个去掉了,其他选框也就没了。。  发表于 2010-11-2 22:23

嗯,不能浪费签名了,打广告。本人的悲剧作品:
坑化游戏《龙之影》      R剧《星空》     小游戏《剑与拳头》
回复

使用道具 举报

Lv2.观梦者

花开堪折直须折

梦石
0
星屑
611
在线时间
943 小时
注册时间
2010-7-17
帖子
4963

贵宾

 楼主| 发表于 2010-11-2 22:22:56 | 显示全部楼层
回复 水镜风生 的帖子

苍天啊!大地啊!你一直在潜水么……= =
大家好,我叫节操,有一天,我被吃了。
http://forever-dream.5d6d.com
永恒の梦制作组论坛

129993099
永恒の梦制作组QQ群
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
65
在线时间
433 小时
注册时间
2007-5-1
帖子
993
发表于 2010-11-2 22:35:20 | 显示全部楼层
回复 冰舞蝶恋 的帖子

Of course,作为一个资深的潜水党,我浮上水面换氧气的时间不多,好好珍惜吧……

嗯,不能浪费签名了,打广告。本人的悲剧作品:
坑化游戏《龙之影》      R剧《星空》     小游戏《剑与拳头》
回复

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
114 小时
注册时间
2008-10-29
帖子
515

开拓者

发表于 2010-11-2 22:36:13 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
72 小时
注册时间
2010-10-18
帖子
104
发表于 2010-11-2 23:10:41 | 显示全部楼层
本帖最后由 迷路子 于 2010-11-2 23:11 编辑

用用看吧
除了存档没做处理外     其他都是去光标   目前选择项描边
不过描边很卡…
移动选项时会lag一下
  1. #==============================================================================
  2. # ■ Window_Selectable
  3. #------------------------------------------------------------------------------
  4. #  拥有光标的移动以及滚动功能的窗口类。
  5. #==============================================================================

  6. class Window_Selectable < Window_Base
  7.   #--------------------------------------------------------------------------
  8.   # ● 更新光标
  9.   #--------------------------------------------------------------------------
  10.   def update_cursor
  11.     self.cursor_rect.empty  
  12.     if @index < 0                   # 当光标位置小于0
  13.       self.cursor_rect.empty        # 隐藏光标
  14.     else                            # 当光标位置为0或大于
  15.       row = @index / @column_max    # 获取当前行
  16.       if row < top_row              # 若先于首行
  17.         self.top_row = row          # 向上滚动
  18.       end
  19.       if row > bottom_row           # 若後于末行
  20.         self.bottom_row = row       # 向下滚动
  21.       end
  22.       rect = item_rect(@index)      # 获取所选项目矩形
  23.       rect.y -= self.oy             # 设矩形为滚动位置
  24.       self.cursor_rect = rect       # 更新光标矩形
  25.       self.cursor_rect.empty
  26.     end
  27.   end
  28.   
  29. end


  30. class Window_Base < Window
  31.   
  32.   #--------------------------------------------------------------------------
  33.   # ○ 描边字
  34.   #--------------------------------------------------------------------------
  35.   def draw_stroke_text(rect, str, enabled = true, align = 0, color = nil)
  36.     x = rect.x
  37.     y = rect.y
  38.     width = rect.width
  39.     height = rect.height

  40.     # 准备字体
  41.     font_backup = self.contents.font.clone
  42.     if color
  43.       self.contents.font.color.red   = color.red
  44.       self.contents.font.color.green = color.green
  45.       self.contents.font.color.blue  = color.blue
  46.     end

  47.     # 关闭默认阴影
  48.     self.contents.font.shadow = false

  49.     # 描绘边缘
  50.     self.contents.font.color.alpha = enabled ? 255 : 128
  51.     self.contents.draw_text(x-1, y-1, width, height, str, align)
  52.     self.contents.draw_text(x-1, y+1, width, height, str, align)
  53.     self.contents.draw_text(x+1, y-1, width, height, str, align)
  54.     self.contents.draw_text(x+1, y+1, width, height, str, align)
  55.     self.contents.draw_text(x, y-1, width, height, str, align)
  56.     self.contents.draw_text(x, y+1, width, height, str, align)
  57.     self.contents.draw_text(x-1, y, width, height, str, align)
  58.     self.contents.draw_text(x+1, y, width, height, str, align)

  59.     # 描绘主文字
  60.     self.contents.font.color = font_backup.color
  61.     self.contents.font.color.alpha = enabled ? 255 : 128
  62.     self.contents.draw_text(x, y, width, height, str, align)
  63.    
  64.     # 还原默认字体
  65.     self.contents.font = font_backup

  66.   end
  67. end

  68. #==============================================================================
  69. # ■ Window_Command   捣鼓 by 水镜风生 (描边字部分出自沉影不器)
  70. #------------------------------------------------------------------------------
  71. #  一般的命令选择行窗口。
  72. #==============================================================================
  73. FONT_COLOR_ID = 1   # 描边颜色ID,请参考[显示文章]中\C[n]的颜色

  74. class Window_Command < Window_Selectable
  75.   #--------------------------------------------------------------------------
  76.   # ● 初始化对象 追加定义
  77.   #--------------------------------------------------------------------------
  78.   alias Mro_initialize initialize  
  79.   def initialize(width, commands, column_max = 1, row_max = 0, spacing = 32)
  80.     @enabled_list = []
  81.     Mro_initialize(width, commands, column_max, row_max, spacing)
  82.   end
  83.   #--------------------------------------------------------------------------
  84.   # ● 描绘项目  追加定义
  85.   #--------------------------------------------------------------------------
  86.   alias Mro_draw_item draw_item
  87.   def draw_item(index, enabled = true)
  88.     @enabled_list[index] = enabled
  89.     Mro_draw_item(index, @enabled_list[index])
  90.   end
  91.   #--------------------------------------------------------------------------
  92.   # ● 更新
  93.   #--------------------------------------------------------------------------
  94.   def update
  95.     super
  96.     if @last_index != self.index
  97.       @last_index = self.index
  98.       for i in 0...@item_max
  99.         rect = item_rect(i)
  100.         self.contents.clear_rect(rect)
  101.         next if i == @old_index
  102.         draw_item(i, @enabled_list[i])
  103.       end
  104.        rect = item_rect(self.index)
  105.        self.contents.clear_rect(rect)
  106.       color = text_color(FONT_COLOR_ID)
  107.       draw_stroke_text(rect, @commands[@index], @enabled_list[@index], 0, color)
  108.     end
  109.   end
  110. end

  111. #==============================================================================
  112. # ■ Window_Item
  113. #------------------------------------------------------------------------------
  114. #  物品画面、战斗画面、显示浏览物品的窗口。
  115. #==============================================================================

  116. class Window_Item < Window_Selectable
  117.   alias Mro_initialize0 initialize
  118.   def initialize(x, y, width, height)
  119.     @enabled_list = []
  120.     Mro_initialize0(x, y, width, height)
  121.   end
  122.   
  123.   #--------------------------------------------------------------------------
  124.   # ● 刷新
  125.   #--------------------------------------------------------------------------  
  126.   def refresh
  127.     @data = []
  128.     for item in $game_party.items
  129.       next unless include?(item)
  130.       @data.push(item)
  131.       if item.is_a?(RPG::Item) and item.id == $game_party.last_item_id
  132.         self.index = @data.size - 1
  133.       end
  134.     end
  135.     @data.push(nil) if include?(nil)
  136.     @item_max = @data.size
  137.     create_contents
  138.     for i in 0...@item_max
  139.       draw_item(i)
  140.     end
  141.   end
  142.   
  143.   def update
  144.     super
  145.     @item_max = @data.size
  146.     create_contents
  147.     for i in 0...@item_max
  148.       rect = item_rect(i)
  149.       self.contents.clear_rect(rect)
  150.       next if i == @old_index
  151.       draw_item(i)
  152.     end
  153.     rect = item_rect(self.index)
  154.     rect.width -= 60
  155.     rect.x += 24
  156.     self.contents.clear_rect(rect)
  157.     color = text_color(FONT_COLOR_ID)
  158.     if @index >= 0 && @index < @item_max-1
  159.       draw_stroke_text(rect, @data[@index].name, @enabled_list[index], 0, color)
  160.     end
  161.   end
  162.   
  163.   #--------------------------------------------------------------------------
  164.   # ● 描绘项目
  165.   #     index : 项目编号
  166.   #--------------------------------------------------------------------------
  167.   def draw_item(index)
  168.     rect = item_rect(index)
  169.     self.contents.clear_rect(rect)
  170.     item = @data[index]
  171.     if item != nil
  172.       number = $game_party.item_number(item)
  173.       enabled = enable?(item)
  174.       rect.width -= 4
  175.       draw_item_name(item, rect.x, rect.y, enabled)
  176.       self.contents.draw_text(rect, sprintf(":%2d", number), 2)
  177.     end
  178.     @enabled_list[index] = enabled
  179.   end
  180. end

  181. class Window_Equip < Window_Selectable
  182.   alias Mro_initialize4 initialize
  183.   def initialize(x, y, actor)
  184.     Mro_initialize4(x, y, actor)
  185.   end
  186.   
  187.   
  188.   def update
  189.     super
  190.     @item_max = @data.size
  191.     create_contents
  192.     for i in 0...@item_max
  193.       rect = item_rect(i)
  194.       self.contents.clear_rect(rect)
  195.       next if i == @old_index
  196.       draw_item_name(@data[i],92,WLH*i)
  197.     end
  198.     rect = item_rect(self.index)
  199.     rect.x += 115
  200.     self.contents.clear_rect(rect)
  201.     color = text_color(FONT_COLOR_ID)
  202.     draw_stroke_text(rect, @data[@index].name, true, 0, color)
  203.     self.contents.font.color = system_color
  204.     if @actor.two_swords_style
  205.       self.contents.draw_text(4, WLH * 0, 92, WLH, Vocab::weapon1)
  206.       self.contents.draw_text(4, WLH * 1, 92, WLH, Vocab::weapon2)
  207.     else
  208.       self.contents.draw_text(4, WLH * 0, 92, WLH, Vocab::weapon)
  209.       self.contents.draw_text(4, WLH * 1, 92, WLH, Vocab::armor1)
  210.     end
  211.     self.contents.draw_text(4, WLH * 2, 92, WLH, Vocab::armor2)
  212.     self.contents.draw_text(4, WLH * 3, 92, WLH, Vocab::armor3)
  213.     self.contents.draw_text(4, WLH * 4, 92, WLH, Vocab::armor4)
  214.   end
  215. end


  216. class Window_Skill < Window_Selectable  
  217.   alias Mro_initialize3 initialize
  218.   def initialize(x, y, width, height, actor)
  219.     @enabled_list = []
  220.     Mro_initialize3(x, y, width, height,actor)
  221.   end
  222.   
  223.   #--------------------------------------------------------------------------
  224.   # ● 描绘项目
  225.   #     index : 项目编号
  226.   #--------------------------------------------------------------------------
  227.   def draw_item(index)
  228.     rect = item_rect(index)
  229.     self.contents.clear_rect(rect)
  230.     skill = @data[index]
  231.     if skill != nil
  232.       rect.width -= 4
  233.       enabled = @actor.skill_can_use?(skill)
  234.       draw_item_name(skill, rect.x, rect.y, enabled)
  235.       self.contents.draw_text(rect, @actor.calc_mp_cost(skill), 2)
  236.     end
  237.     @enabled_list[index] = enabled
  238.   end
  239.   
  240.   def update
  241.     super
  242.     @item_max = @data.size
  243.     create_contents
  244.     for i in 0...@item_max
  245.       rect = item_rect(i)
  246.       self.contents.clear_rect(rect)
  247.       next if i == @old_index
  248.       draw_item(i)
  249.     end
  250.     rect = item_rect(self.index)
  251.     rect.width -= 60
  252.     rect.x += 24
  253.     self.contents.clear_rect(rect)
  254.     color = text_color(FONT_COLOR_ID)
  255.     draw_stroke_text(rect, @data[@index].name, @enabled_list[index], 0, color)
  256.   end
  257. end
复制代码
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
518 小时
注册时间
2010-6-16
帖子
1073
发表于 2010-11-2 23:12:54 | 显示全部楼层
本帖最后由 Rion幻音 于 2010-11-3 00:24 编辑

回复 冰舞蝶恋 的帖子

Untitled2.png New.png
像这样的效果吗?文字描边~

点评

颜色是可以随意更改的  发表于 2010-11-3 08:19
这感觉类似粗体 描边应该是像水镜的那个脚本绘出的模样比较明显  发表于 2010-11-3 00:34
回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1224
在线时间
667 小时
注册时间
2009-11-11
帖子
2787
发表于 2010-11-3 12:18:10 | 显示全部楼层
本帖最后由 summer92 于 2010-11-3 12:22 编辑

晕,有大神回答了,我就不献丑了,祝早日完工,另建议可用 photoshop

嘿。嘿。嘿
回复

使用道具 举报

Lv2.观梦者

花开堪折直须折

梦石
0
星屑
611
在线时间
943 小时
注册时间
2010-7-17
帖子
4963

贵宾

 楼主| 发表于 2010-11-3 12:33:42 | 显示全部楼层
回复 Rion幻音 的帖子

不是所有文字描边,是所有选中界面的文字描边。。
大家好,我叫节操,有一天,我被吃了。
http://forever-dream.5d6d.com
永恒の梦制作组论坛

129993099
永恒の梦制作组QQ群
回复

使用道具 举报

Lv2.观梦者

花开堪折直须折

梦石
0
星屑
611
在线时间
943 小时
注册时间
2010-7-17
帖子
4963

贵宾

 楼主| 发表于 2010-11-3 12:36:53 | 显示全部楼层
本帖最后由 冰舞蝶恋 于 2010-11-3 12:42 编辑

回复 迷路子 的帖子

非常感谢,不过,为何选择物品或是特技、装备,就脚本出错了呢?(当没有该类事物的时候)另,文章选项窗口还是不能描边啊。。谢谢!
大家好,我叫节操,有一天,我被吃了。
http://forever-dream.5d6d.com
永恒の梦制作组论坛

129993099
永恒の梦制作组QQ群
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-3-29 19:08

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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