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

Project1

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

[已经解决] 关于黑色笔记的那个仿网游系统

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
11 小时
注册时间
2013-10-5
帖子
24
跳转到指定楼层
1
发表于 2013-11-2 17:29:44 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
那个仿网游系统怎么去掉那个打字框?

QQ图片20131102172757.jpg (89.3 KB, 下载次数: 25)

QQ图片20131102172757.jpg

Lv4.逐梦者 (版主)

百合控

梦石
0
星屑
6543
在线时间
1275 小时
注册时间
2013-8-21
帖子
3657

开拓者

2
发表于 2013-11-2 21:35:06 | 只看该作者
用这个替换原Game_MapChat
下次直接去找原作者,或者发脚本,要不是我正好看到过这东西,谁知道你说的是什么
RUBY 代码复制
  1. #encoding:utf-8
  2. #==============================================================================
  3. # ■ Game_MapChat
  4. #------------------------------------------------------------------------------
  5. #  处理地图Chat的类。
  6. #==============================================================================
  7.  
  8. class Game_MapChat
  9.  
  10.   DataLine = 8
  11.  
  12.   def initialize
  13.     @viewport = Viewport.new(0, Graphics.height - (16 * DataLine + 18), 256, 16 * DataLine + 18)
  14.     @chatdata = Sprite.new(@viewport)
  15.     @chatdata.bitmap = Bitmap.new(@viewport.rect.width, 16 * DataLine)
  16.     @chatdata.bitmap.font.shadow = true
  17.     @chatdata_pos = 0
  18.     @chatdatas = []
  19.   end
  20.  
  21.   def dispose
  22.     @viewport.dispose
  23.     @chatdata.dispose
  24.   end
  25.  
  26.   def update
  27.   end
  28.  
  29.   def refresh
  30.     @chatdata.bitmap.clear
  31.     @chatdata.bitmap.font.color.set(255, 255, 255, 255)
  32.     for i in @chatdata_pos...(@chatdata_pos+ 1)
  33.       break unless i < @chatdatas.size
  34.       x = 2
  35.       data = ""
  36.       text = @chatdatas[i].clone
  37.       while char = text.slice!(/./m)
  38.         case char
  39.         when "\001"
  40.           color_string = ""
  41.           while c = text.slice!(/./m)
  42.             case c
  43.             when "["
  44.               next
  45.             when "]"
  46.               break
  47.             else
  48.               color_string += c
  49.               next
  50.             end
  51.           end
  52.           color_string = color_string.split(/,/)
  53.           r = (color_string[0] || 255).to_i
  54.           g = (color_string[1] || 255).to_i
  55.           b = (color_string[2] || 255).to_i
  56.           a = (color_string[3] || 255).to_i
  57.           @chatdata.bitmap.font.color.set(r, g, b, a)
  58.           next
  59.         end
  60.         @chatdata.bitmap.draw_text(x, (i - @chatdata_pos) * 16, 230, 16, char)
  61.         x += @chatdata.bitmap.text_size(char).width
  62.       end
  63.     end
  64.   end
  65.  
  66.   def add(text)
  67.     x = 2
  68.     y = 0
  69.     data = []
  70.     last_color = Color.new(255, 255, 255, 255)
  71.     text = "\001[255, 255, 255, 255]" + text
  72.     text.gsub!(/\\[Cc]/) { "\001" }
  73.     while char = text.slice!(/./m)
  74.       case char
  75.       when "\001"
  76.         data[y] ||= ""
  77.         data[y] += char
  78.         color_string = ""
  79.         while c = text.slice!(/./m)
  80.           data[y] += c
  81.           case c
  82.           when "["
  83.             next
  84.           when "]"
  85.             break
  86.           else
  87.             color_string += c
  88.             next
  89.           end
  90.         end
  91.         color_string = color_string.split(/,/)
  92.         r = (color_string[0] || 255).to_i
  93.         g = (color_string[1] || 255).to_i
  94.         b = (color_string[2] || 255).to_i
  95.         a = (color_string[3] || 255).to_i
  96.         last_color.set(r, g, b, a)
  97.         next
  98.       else
  99.         if x >= @chatdata.bitmap.width - 8
  100.           x = @chatdata.bitmap.text_size("    ").width
  101.           y += 1
  102.         end
  103.         case char
  104.         when "\n"
  105.           x = @chatdata.bitmap.text_size("    ").width
  106.           y += 1
  107.           next
  108.         end
  109.         x += @chatdata.bitmap.text_size(char).width
  110.       end
  111.  
  112.       unless (data[y] ||= "").size > 0
  113.         color = last_color
  114.         char = "\001[#{color.red}, #{color.green}, #{color.blue}, #{color.alpha}]    " + char
  115.       end
  116.       data[y] += char
  117.     end
  118.     @chatdatas += data
  119.   end
  120.  
  121.  
  122.   def send(message, type = 2)
  123.     case type
  124.     when 0
  125.       message = "\001[255, 128, 128][RubyCode] " + message
  126.     when 1
  127.       message = "\001[255, 255, 255][附近] " + message
  128.     when 2
  129.       message = "\001[128, 192, 255]" + message
  130.     end
  131.     add(message)
  132.     @chatdata_pos = [0, @chatdatas.size - 1].max
  133.     refresh
  134.   end
  135. end

评分

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

查看全部评分

萌新瑟瑟发抖
看到我请叫我去干活
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-25 17:23

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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