Project1

标题: 练手 - 自由字体选项窗口 [打印本页]

作者: 忧雪の伤    时间: 2011-6-18 19:12
标题: 练手 - 自由字体选项窗口
  1. #==============================================================================
  2. # ** 伪·热心辅导班
  3. #==============================================================================

  4. class Window_Free_Command < Window_Command
  5.   attr_accessor(:free_system)
  6.   def initialize(width, commands, size, font, color)
  7.     self.free_system = [size, font, color]
  8.     super(width, commands)
  9.   end
  10.   def refresh
  11.     self.contents.clear
  12.     @item_max.times {|time| draw_item(time, self.free_system[2]) }
  13.   end
  14.   def draw_item(index, color)
  15.     self.contents.font.size = self.free_system[0]
  16.     self.contents.font.name = self.free_system[1]
  17.     super(index, color)
  18.   end
  19. end
复制代码


方法:
Window_Free_Command.new(width, commands, size, font, color)
前面两个是Window_Command就存在的参数。
后面三个,分别是描绘字符的字体大小,字体名称,字体颜色。

作者: 一瞬间的幻觉    时间: 2011-6-18 23:46
早上刚说就做出来了啊~~

具体怎么应用到游戏里面去?类似对话框文字属性?
作者: 柳之一    时间: 2011-6-19 00:18
一瞬间的幻觉 发表于 2011-6-18 23:46
早上刚说就做出来了啊~~

具体怎么应用到游戏里面去?类似对话框文字属性? ...

@a=Window_Free_Command.new(480, $commands, 24, $font, red)类似这样




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1