Project1

标题: 请问如何把战斗中的人物名称的字体改颜色? [打印本页]

作者: 346580358    时间: 2008-6-2 18:29
标题: 请问如何把战斗中的人物名称的字体改颜色?


就是早苗这个名字~白色看不太清楚~怎么改成黑色或者其他颜色? [LINE]1,#dddddd[/LINE]此贴于 2008-6-8 18:15:29 被版主光郎提醒,请楼主看到后对本贴做出回应。 [LINE]1,#dddddd[/LINE]版务信息:版主帮忙结贴~
作者: alonescud    时间: 2008-6-2 18:33
应该是Window_Base里的

def draw_actor_name(actor, x, y)
    self.contents.font.color = normal_color
      self.contents.draw_text(x, y, 120, 45, actor.name)  
   end


例,你可以把那行改成:self.contents.font.color = Color.new(225,-215,-225,200)

那就是红色了. [LINE]1,#dddddd[/LINE]系统信息:本贴由本区版主认可为正确答案,66RPG感谢您的热情解答~
作者: horussakai    时间: 2008-6-2 19:06
太麻烦了,不知道VB里有没实现颜色的代码,不用老RGB吧~~


比如

self.contents.font.color = Color.new(Color.RED)之类的.........有没有这类的
作者: alonescud    时间: 2008-6-2 19:08
MS有这种的  Color.new(255,green,blue,200)
作者: 禾西    时间: 2008-6-2 19:16
可以自己在 class Window_Base下增加方法
比如
def red
  return Color.new(225,-215,-225,200)
end

然後就可以使用
self.contents.font.color = red
來實現
作者: alonescud    时间: 2008-6-2 19:26
以下引用禾西于2008-6-2 11:16:08的发言:

可以自己在 class Window_Base下增加方法
比如
def red
return Color.new(225,-215,-225,200)
end

然後就可以使用
self.contents.font.color = red
來實現



还是要找(x.x.x.x)对应的颜色值,楼主就是怕这个麻烦,太懒了 {/cy}
作者: 八云紫    时间: 2008-6-2 19:58
怕找三原色的话,可以试试 流星姐 发的这个工具:

http://rpg.blue/viewthread.php?tid=76392&ntime=2008%2D6%2D2+11%3A57%3A20
作者: horussakai    时间: 2008-6-2 22:12
我都觉得奇怪,怎么会有负数,红色明明是255,0,0


还有最后第四个参数,莫非是透明度的意思?
作者: 雪流星    时间: 2008-6-2 22:17
http://www.w3schools.com/html/html_colornames.asp
顏色列表
加上剛才紫妹提供給你的工具獲取三原色
或是直接用下面的腳本
self.contents.color = 某顏色名
下面的腳本還沒打完
目前到 fire_brick
  1. class Window
  2.   #============================================================================
  3.   #  紅色
  4.   #============================================================================
  5.   def red
  6.     return Color.new(255, 0, 0)
  7.   end
  8.   #============================================================================
  9.   #  綠色
  10.   #============================================================================
  11.   def green
  12.     return Color.new(0, 255, 0)
  13.   end
  14.   #============================================================================
  15.   #  藍色
  16.   #============================================================================
  17.   def blue
  18.     return Color.new(0, 0, 255)
  19.   end
  20.   #============================================================================
  21.   #  黃色
  22.   #============================================================================
  23.   def yellow
  24.     return Color.new(255, 255, 0)
  25.   end
  26.   #============================================================================
  27.   #  藍綠色
  28.   #============================================================================
  29.   def cyan
  30.     return Color.new(0, 255, 255)
  31.   end
  32.   #============================================================================
  33.   #  洋紅色
  34.   #============================================================================
  35.   def magenta
  36.     return Color.new(255, 0, 255)
  37.   end
  38.   #============================================================================
  39.   #  白色
  40.   #============================================================================
  41.   def white
  42.     return Color.new(255, 255, 255)
  43.   end
  44.   #============================================================================
  45.   #  黑色
  46.   #============================================================================
  47.   def black
  48.     return Color.new(0, 0, 0)
  49.   end
  50.   #============================================================================
  51.   #  灰色
  52.   #============================================================================
  53.   def grey
  54.     return Color.new(128, 128, 128)
  55.   end
  56.   #============================================================================
  57.   #  冰藍色
  58.   #============================================================================
  59.   def alice_blue
  60.     return Color.new(240,248,255)
  61.   end
  62.   #============================================================================
  63.   #  骨董白
  64.   #============================================================================
  65.   def antique_white
  66.     return Color.new(250,235,215)
  67.   end
  68.   #============================================================================
  69.   #  水藍色
  70.   #============================================================================
  71.   def aqua
  72.     return Color.new(0,237,255)
  73.   end
  74.   #============================================================================
  75.   #  碧綠色
  76.   #============================================================================
  77.   def aquamarine
  78.     return Color.new(127,255,212)
  79.   end
  80.   #============================================================================
  81.   #  淡青色
  82.   #============================================================================
  83.   def azure
  84.     return Color.new(240,255,255)
  85.   end
  86.   #============================================================================
  87.   #  灰棕色
  88.   #============================================================================
  89.   def beige
  90.     return Color.new(245,245,220)
  91.   end
  92.   #============================================================================
  93.   #  陶黃色
  94.   #============================================================================
  95.   def bisque
  96.     return Color.new(255,228,196)
  97.   end
  98.   #============================================================================
  99.   #  杏白色
  100.   #============================================================================
  101.   def blanched_almond
  102.     return Color.new(255,235,205)
  103.   end
  104.   #============================================================================
  105.   #  藍紫色
  106.   #============================================================================
  107.   def blue_violet
  108.     return Color.new(138,43,226)
  109.   end
  110.   #============================================================================
  111.   #  棕色
  112.   #============================================================================
  113.   def brown
  114.     return Color.new(165,42,42)
  115.   end
  116.   #============================================================================
  117.   #  粗木色
  118.   #============================================================================
  119.   def burly_wood
  120.     return Color.new(222,184,135)
  121.   end
  122.   #============================================================================
  123.   #  軍藍色
  124.   #============================================================================
  125.   def cadet_blue
  126.     return Color.new(95,158,160)
  127.   end
  128.   #============================================================================
  129.   #  淡黃綠色
  130.   #============================================================================
  131.   def chartreuse
  132.     return Color.new(127,255,0)
  133.   end
  134.   #============================================================================
  135.   #  巧克力色
  136.   #============================================================================
  137.   def chocolate
  138.     return Color.new(210,105,30)
  139.   end
  140.   #============================================================================
  141.   #  珊瑚色
  142.   #============================================================================
  143.   def coral
  144.     return Color.new(255,127,80)
  145.   end
  146.   #============================================================================
  147.   #  瞿麥藍色
  148.   #============================================================================
  149.   def cornflower_blue
  150.     return Color.new(100,149,237)
  151.   end
  152.   #============================================================================
  153.   #  黍穗色
  154.   #============================================================================
  155.   def cornsilk
  156.     return Color.new(255,248,220)
  157.   end
  158.   #============================================================================
  159.   #  深紅色
  160.   #============================================================================
  161.   def crimson
  162.     return Color.new(220,20,60)
  163.   end
  164.   #============================================================================
  165.   #  暗藍色
  166.   #============================================================================
  167.   def dark_blue
  168.     return Color.new(0,0,139)
  169.   end
  170.   #============================================================================
  171.   #  暗藍綠色
  172.   #============================================================================
  173.   def dark_cyan
  174.     return Color.new(0,139,139)
  175.   end
  176.   #============================================================================
  177.   #  暗金黃色
  178.   #============================================================================
  179.   def dark_goldenrod
  180.     return Color.new(184,134,11)
  181.   end
  182.   #============================================================================
  183.   #  暗灰色
  184.   #============================================================================
  185.   def dark_grey
  186.     return Color.new(169,169,169)
  187.   end
  188.   #============================================================================
  189.   #  暗綠色
  190.   #============================================================================
  191.   def dark_green
  192.     return Color.new(0,100,0)
  193.   end
  194.   #============================================================================
  195.   #  暗黃褐色
  196.   #============================================================================
  197.   def dark_khaki
  198.     return Color.new(189,183,107)
  199.   end
  200.   #============================================================================
  201.   #  暗洋紅色
  202.   #============================================================================
  203.   def dark_magenta
  204.     return Color.new(139,0,139)
  205.   end
  206.   #============================================================================
  207.   #  暗橄欖綠色
  208.   #============================================================================
  209.   def dark_olive_green
  210.     return Color.new(85,107,47)
  211.   end
  212.   #============================================================================
  213.   #  暗橘色
  214.   #============================================================================
  215.   def dark_orange
  216.     return Color.new(255,140,0)
  217.   end
  218.   #============================================================================
  219.   #  暗紫蘭色
  220.   #============================================================================
  221.   def dark_orchid
  222.     return Color.new(153,50,204)
  223.   end
  224.   #============================================================================
  225.   #  暗紅色
  226.   #============================================================================
  227.   def dark_red
  228.     return Color.new(139,0,0)
  229.   end
  230.   #============================================================================
  231.   #  暗粉紅色
  232.   #============================================================================
  233.   def dark_salmon
  234.     return Color.new(233,150,122)
  235.   end
  236.   #============================================================================
  237.   #  暗海綠色
  238.   #============================================================================
  239.   def dark_seagreen
  240.     return Color.new(143,188,143)
  241.   end
  242.   #============================================================================
  243.   #  暗石板藍
  244.   #============================================================================
  245.   def dark_slate_blue
  246.     return Color.new(72,61,139)
  247.   end
  248.   #============================================================================
  249.   #  暗石板灰
  250.   #============================================================================
  251.   def dark_slate_grey
  252.     return Color.new(47,79,79)
  253.   end
  254.   #============================================================================
  255.   #  暗青綠色
  256.   #============================================================================
  257.   def dark_turquoise
  258.     return Color.new(0,206,209)
  259.   end
  260.   #============================================================================
  261.   #  暗紫色
  262.   #============================================================================
  263.   def dark_violet
  264.     return Color.new(148,0,211)
  265.   end
  266.   #============================================================================
  267.   #  深粉紅色
  268.   #============================================================================
  269.   def deep_pink
  270.     return Color.new(255,20,147)
  271.   end
  272.   #============================================================================
  273.   #  深天藍色
  274.   #============================================================================
  275.   def deep_sky_blue
  276.     return Color.new(0,191,255)
  277.   end
  278.   #============================================================================
  279.   #  幽灰色
  280.   #============================================================================
  281.   def dim_grey
  282.     return Color.new(105,105,105)
  283.   end
  284.   #============================================================================
  285.   #  混藍色
  286.   #============================================================================
  287.   def dodger_blue
  288.     return Color.new(30,144,255)
  289.   end
  290.   #============================================================================
  291.   #  火磚紅
  292.   #============================================================================
  293.   def fire_brick
  294.     return Color.new(178,34,34)
  295.   end
  296.   #============================================================================
  297.   #  顏色
  298.   #============================================================================
  299.   def color
  300.     return Color.new(255, 255, 255)
  301.   end
  302. end
复制代码

作者: xyxw    时间: 2008-6-2 22:50
正好想问一个差不多的问题,就借用楼主的帖子吧。。。。
字体的大小在哪里改?
作者: 346580358    时间: 2008-6-2 23:28
以下引用xyxw于2008-6-2 14:50:09的发言:

正好想问一个差不多的问题,就借用楼主的帖子吧。。。。
字体的大小在哪里改?

这个我也知道哈
作者: OCTSJimmy    时间: 2008-6-2 23:35
改大小……想尽一切办法找size……不知道我记错了没……几亿年没摸RMXP了……{/gg}{/hx}{/lh}
作者: 雪流星    时间: 2008-6-3 03:46
self.contents.font.size = N




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