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

Project1

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

[已经解决] 自制窗口右侧的小箭头怎么去掉?

[复制链接]

Lv4.逐梦者

梦石
3
星屑
6420
在线时间
1131 小时
注册时间
2007-12-26
帖子
2402
跳转到指定楼层
1
发表于 2014-8-22 14:35:59 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
改了某个窗口脚本,做一个用来显示图片的窗口,但是右侧一直有一个小三角箭头,希望去除



工程:
Project4.rar (213.76 KB, 下载次数: 38)

RUBY 代码复制
  1. class Window_smap_Command < Window_Selectable
  2.   #--------------------------------------------------------------------------
  3.   # ● 初始化对像
  4.   #     width    : 窗口的宽
  5.   #     commands : 命令字符串序列
  6.   #--------------------------------------------------------------------------
  7.   def initialize(width, commands)
  8.     super(132, 64, width*2, 96)
  9.     @item_max = 10
  10.     @commands = commands
  11.      self.contents = Bitmap.new(width - 32, @item_max * 32)
  12.     $cw_index = 0
  13.     refresh
  14.     self.index = 0
  15.   end
  16.   #--------------------------------------------------------------------------
  17.   # ● 刷新
  18.   #--------------------------------------------------------------------------
  19.   def refresh
  20.     self.contents.clear
  21.     for i in 0...@item_max
  22.       draw_item(i, normal_color)
  23.     end
  24.   end
  25.   #--------------------------------------------------------------------------
  26.   # ● 描绘项目
  27.   #     index : 项目编号
  28.   #     color : 文字色
  29.   #--------------------------------------------------------------------------
  30.   def draw_item(index, color)
  31.     self.contents.font.color = color
  32.     rect = Rect.new(4, 32 * index, self.contents.width - 8, 32)
  33.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  34.     self.contents.draw_text(rect, @commands[index].to_s)
  35.   end
  36.   #--------------------------------------------------------------------------
  37.   # ● 项目无效化
  38.   #     index : 项目编号
  39.   #--------------------------------------------------------------------------
  40.   def disable_item(index)
  41.     draw_item(index, disabled_color)
  42.   end
  43.   def able_item(index)
  44.     draw_item(index, normal_color)
  45.   end
  46. end
  47. class Window_Base < Window
  48.   def draw_smap(actor, x, y)
  49.     bitmap=Bitmap.new("Graphics/Pictures/smap4")
  50.     src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  51.     self.contents.blt(x-192, y+40, bitmap, src_rect)  
  52.     x = 83
  53.     y = 64
  54.   end
  55. end
  56. #==============================================================================
  57. class Window_smap < Window_Base
  58.   #--------------------------------------------------------------------------
  59.   # ● 初始化对像
  60.   #     actor : 角色
  61.   #--------------------------------------------------------------------------
  62.   def initialize(actor)
  63.     super(0, 0, 360, 240)
  64.     self.contents = Bitmap.new(width + 32, height - 32)
  65.     @actor = actor
  66.     refresh
  67.   end  
  68.   #--------------------------------------------------------------------------
  69.   # ● 刷新
  70.   #--------------------------------------------------------------------------
  71.   def refresh
  72.     self.contents.clear   
  73.     draw_smap(@actor, 160, -40)
  74.   end
  75. end
  76. class Scene_smap
  77.   #--------------------------------------------------------------------------
  78.   # ● 初始化对像
  79.   #     actor_index : 角色索引
  80.   #     menu_index : 选项起始位置
  81.   #--------------------------------------------------------------------------
  82.   def initialize(actor_index = 0 , menu_index = 0)
  83.     @actor_index = actor_index
  84.     @menu_index = menu_index
  85.   end
  86.   #--------------------------------------------------------------------------
  87.   # ● 主处理
  88.   #--------------------------------------------------------------------------
  89.   def main
  90.     s1 = "地图1"
  91.     s2 = "地图2"
  92.     s3 = "地图3"
  93.     s4 = "地图4"
  94.     s5 = "地图5"
  95.     s6 = "地图6"
  96.     s7 = "地图7"
  97.     s8 = "地图8"
  98.     s9 = "地图9"
  99.     s10 = "退出"
  100.     @command_window = Window_smap_Command.new(180, [s1,s2,s3,s4,s5,s6,s7,s8,s9,s10])
  101.     @command_window.index = @menu_index
  102.     @smap_window = Window_smap.new(@actor)
  103.     #XXOO右窗口的坐标
  104.     @smap_window.x = 132
  105.     @smap_window.y = 180
  106.     @cursor_index = @command_window.index
  107.     # 执行过渡 渐变图形的文件位置 自己设定
  108.     Graphics.transition
  109.     # 主循环
  110.     loop do# 刷新游戏画面      
  111.       Graphics.update     
  112.       Input.update # 刷新输入信息      
  113.       update# 刷新画面   
  114.       if $scene != self # 如果切换画面就中断循环
  115.         break
  116.       end
  117.     end
  118.     # 准备过渡
  119.     Graphics.freeze# 释放窗口   
  120.     @command_window.dispose
  121.     @smap_window.dispose
  122.   end
  123.  
  124.   #--------------------------------------------------------------------------
  125.   # ● 刷新画面
  126.   #--------------------------------------------------------------------------
  127.   def update
  128.     # 刷新窗口
  129.     @command_window.update
  130.     if @cursor_index != @command_window.index
  131.       $cw_index = @command_window.index
  132.       @smap_window.refresh
  133.       @cursor_index = @command_window.index
  134.     end
  135.     # 选项明暗判断
  136.     @smap_window.update
  137.     #=============================================================
  138.     # 按下 B 键的情况下
  139.     #=============================================================
  140.     if Input.trigger?(Input::B)
  141.       # 演奏取消 SE
  142.       $game_system.se_play($data_system.cancel_se)
  143.       @command_window.index = 9
  144.       return
  145.     end
  146.   end
  147. end


评分

参与人数 1星屑 +35 收起 理由
RyanBern + 35 手动认可奖励

查看全部评分

囡囚囨囚囨図囨囧

Lv3.寻梦者

梦石
0
星屑
3846
在线时间
1966 小时
注册时间
2013-1-3
帖子
9536
2
发表于 2014-8-22 15:18:58 | 只看该作者
可以重新添加一个Window_Selectable2
但还是该改windowskin简单些
《宿愿·寻剑篇》正式版已经发布!快去看看!点击进入论坛发布贴
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
33071
在线时间
5103 小时
注册时间
2012-11-19
帖子
4878

开拓者

3
发表于 2014-8-22 15:31:01 | 只看该作者
第 64 行:self.contents = Bitmap.new(width + 32, height - 32)
改成:self.contents = Bitmap.new(width - 32, height - 32)

点评

谢谢!  发表于 2014-8-23 09:27

评分

参与人数 2星屑 +350 收起 理由
︶ㄣ牛排ぶ + 200 认可答案
RyanBern + 150 认可答案

查看全部评分

xp vx va mv  va mz 各类型脚本/插件定制
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-21 15:23

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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