Project1

标题: 很容易的问题,Color类在哪个脚本里?需要替换 [打印本页]

作者: horussakai    时间: 2008-8-21 18:57
标题: 很容易的问题,Color类在哪个脚本里?需要替换

这个Color类怎么用啊?我没看到有替换的脚本啊?不是又要手写到MAIN里吧?

问题简单吧,赶紧回答,马上给分哈{/cy}{/cy}



  1. class Color
  2. def self.lightpink(opacity = 255);new(255,182,193,opacity);end
  3. def self.pink(opacity = 255);new(255,192,203,opacity);end
  4. def self.crimson(opacity = 255);new(220,20,60,opacity);end
  5. def self.lavenderblush(opacity = 255);new(255,240,245,opacity);end
  6. def self.palevioletred(opacity = 255);new(219,112,147,opacity);end
  7. def self.hotpink(opacity = 255);new(255,105,180,opacity);end
  8. def self.deeppink(opacity = 255);new(255,20,147,opacity);end
  9. def self.mediumvioletred(opacity = 255);new(199,21,133,opacity);end
  10. def self.orchid(opacity = 255);new(218,112,214,opacity);end
  11. def self.thistle(opacity = 255);new(216,191,216,opacity);end
  12. def self.plum(opacity = 255);new(221,160,221,opacity);end
  13. def self.violet(opacity = 255);new(238,130,238,opacity);end
  14. def self.magenta(opacity = 255);new(255,0,255,opacity);end
  15. def self.fuchsia(opacity = 255);new(255,0,255,opacity);end
  16. def self.darkmagenta(opacity = 255);new(139,0,139,opacity);end
  17. def self.purple(opacity = 255);new(128,0,128,opacity);end
  18. def self.mediumorchid(opacity = 255);new(186,85,211,opacity);end
  19. def self.darkvoilet(opacity = 255);new(148,0,211,opacity);end
  20. def self.darkorchid(opacity = 255);new(153,50,204,opacity);end
  21. def self.indigo(opacity = 255);new(75,0,130,opacity);end
  22. def self.blueviolet(opacity = 255);new(138,43,226,opacity);end
  23. def self.mediumpurple(opacity = 255);new(147,112,219,opacity);end
  24. def self.mediumslateblue(opacity = 255);new(123,104,238,opacity);end
  25. def self.slateblue(opacity = 255);new(106,90,205,opacity);end
  26. def self.darkslateblue(opacity = 255);new(72,61,139,opacity);end
  27. def self.lavender(opacity = 255);new(230,230,250,opacity);end
  28. def self.ghostwhite(opacity = 255);new(248,248,255,opacity);end
  29. def self.blue(opacity = 255);new(0,0,255,opacity);end
  30. def self.mediumblue(opacity = 255);new(0,0,205,opacity);end
  31. def self.midnightblue(opacity = 255);new(25,25,112,opacity);end
  32. def self.darkblue(opacity = 255);new(0,0,139,opacity);end
  33. def self.navy(opacity = 255);new(0,0,128,opacity);end
  34. def self.royalblue(opacity = 255);new(65,105,225,opacity);end
  35. def self.cornflowerblue(opacity = 255);new(100,149,237,opacity);end
  36. def self.lightsteelblue(opacity = 255);new(176,196,222,opacity);end
  37. def self.lightslategray(opacity = 255);new(119,136,153,opacity);end
  38. def self.slategray(opacity = 255);new(112,128,144,opacity);end
  39. def self.doderblue(opacity = 255);new(30,144,255,opacity);end
  40. def self.aliceblue(opacity = 255);new(240,248,255,opacity);end
  41. def self.steelblue(opacity = 255);new(70,130,180,opacity);end
  42. def self.lightskyblue(opacity = 255);new(135,206,250,opacity);end
  43. def self.skyblue(opacity = 255);new(135,206,235,opacity);end
  44. def self.deepskyblue(opacity = 255);new(0,191,255,opacity);end
  45. def self.lightblue(opacity = 255);new(173,216,230,opacity);end
  46. def self.powderblue(opacity = 255);new(176,224,230,opacity);end
  47. def self.cadetblue(opacity = 255);new(95,158,160,opacity);end
  48. def self.azure(opacity = 255);new(240,255,255,opacity);end
  49. def self.lightcyan(opacity = 255);new(225,255,255,opacity);end
  50. def self.paleturquoise(opacity = 255);new(175,238,238,opacity);end
  51. def self.cyan(opacity = 255);new(0,255,255,opacity);end
  52. def self.aqua(opacity = 255);new(0,255,255,opacity);end
  53. def self.darkturquoise(opacity = 255);new(0,206,209,opacity);end
  54. def self.darkslategray(opacity = 255);new(47,79,79,opacity);end
  55. def self.darkcyan(opacity = 255);new(0,139,139,opacity);end
  56. def self.teal(opacity = 255);new(0,128,128,opacity);end
  57. def self.mediumturquoise(opacity = 255);new(72,209,204,opacity);end
  58. def self.lightseagreen(opacity = 255);new(32,178,170,opacity);end
  59. def self.turquoise(opacity = 255);new(64,224,208,opacity);end
  60. def self.auqamarin(opacity = 255);new(127,255,170,opacity);end
  61. def self.mediumaquamarine(opacity = 255);new(0,250,154,opacity);end
  62. def self.mediumspringgreen(opacity = 255);new(245,255,250,opacity);end
  63. def self.mintcream(opacity = 255);new(0,255,127,opacity);end
  64. def self.springgreen(opacity = 255);new(60,179,113,opacity);end
  65. def self.seagreen(opacity = 255);new(46,139,87,opacity);end
  66. def self.honeydew(opacity = 255);new(240,255,240,opacity);end
  67. def self.lightgreen(opacity = 255);new(144,238,144,opacity);end
  68. def self.palegreen(opacity = 255);new(152,251,152,opacity);end
  69. def self.darkseagreen(opacity = 255);new(143,188,143,opacity);end
  70. def self.limegreen(opacity = 255);new(50,205,50,opacity);end
  71. def self.lime(opacity = 255);new(0,255,0,opacity);end
  72. def self.forestgreen(opacity = 255);new(34,139,34,opacity);end
  73. def self.green(opacity = 255);new(0,128,0,opacity);end
  74. def self.darkgreen(opacity = 255);new(0,100,0,opacity);end
  75. def self.chartreuse(opacity = 255);new(127,255,0,opacity);end
  76. def self.lawngreen(opacity = 255);new(124,252,0,opacity);end
  77. def self.greenyellow(opacity = 255);new(173,255,47,opacity);end
  78. def self.olivedrab(opacity = 255);new(85,107,47,opacity);end
  79. def self.beige(opacity = 255);new(107,142,35,opacity);end
  80. def self.lightgoldenrodyellow(opacity = 255);new(250,250,210,opacity);end
  81. def self.ivory(opacity = 255);new(255,255,240,opacity);end
  82. def self.lightyellow(opacity = 255);new(255,255,224,opacity);end
  83. def self.yellow(opacity = 255);new(255,255,0,opacity);end
  84. def self.olive(opacity = 255);new(128,128,0,opacity);end
  85. def self.darkkhaki(opacity = 255);new(189,183,107,opacity);end
  86. def self.lemonchiffon(opacity = 255);new(255,250,205,opacity);end
  87. def self.palegodenrod(opacity = 255);new(238,232,170,opacity);end
  88. def self.khaki(opacity = 255);new(240,230,140,opacity);end
  89. def self.gold(opacity = 255);new(255,215,0,opacity);end
  90. def self.cornislk(opacity = 255);new(255,248,220,opacity);end
  91. def self.goldenrod(opacity = 255);new(218,165,32,opacity);end
  92. def self.floralwhite(opacity = 255);new(255,250,240,opacity);end
  93. def self.oldlace(opacity = 255);new(253,245,230,opacity);end
  94. def self.wheat(opacity = 255);new(245,222,179,opacity);end
  95. def self.moccasin(opacity = 255);new(255,228,181,opacity);end
  96. def self.orange(opacity = 255);new(255,165,0,opacity);end
  97. def self.papayawhip(opacity = 255);new(255,239,213,opacity);end
  98. def self.blanchedalmond(opacity = 255);new(255,235,205,opacity);end
  99. def self.navajowhite(opacity = 255);new(255,222,173,opacity);end
  100. def self.antiquewhite(opacity = 255);new(250,235,215,opacity);end
  101. def self.tan(opacity = 255);new(210,180,140,opacity);end
  102. def self.brulywood(opacity = 255);new(222,184,135,opacity);end
  103. def self.bisque(opacity = 255);new(255,228,196,opacity);end
  104. def self.darkorange(opacity = 255);new(255,140,0,opacity);end
  105. def self.linen(opacity = 255);new(250,240,230,opacity);end
  106. def self.peru(opacity = 255);new(205,133,63,opacity);end
  107. def self.peachpuff(opacity = 255);new(255,218,185,opacity);end
  108. def self.sandybrown(opacity = 255);new(244,164,96,opacity);end
  109. def self.chocolate(opacity = 255);new(210,105,30,opacity);end
  110. def self.saddlebrown(opacity = 255);new(139,69,19,opacity);end
  111. def self.seashell(opacity = 255);new(255,245,238,opacity);end
  112. def self.sienna(opacity = 255);new(160,82,45,opacity);end
  113. def self.lightsalmon(opacity = 255);new(255,160,122,opacity);end
  114. def self.coral(opacity = 255);new(255,127,80,opacity);end
  115. def self.orangered(opacity = 255);new(255,69,0,opacity);end
  116. def self.darksalmon(opacity = 255);new(233,150,122,opacity);end
  117. def self.tomato(opacity = 255);new(255,99,71,opacity);end
  118. def self.mistyrose(opacity = 255);new(255,228,225,opacity);end
  119. def self.salmon(opacity = 255);new(250,128,114,opacity);end
  120. def self.snow(opacity = 255);new(255,250,250,opacity);end
  121. def self.lightcoral(opacity = 255);new(240,128,128,opacity);end
  122. def self.rosybrown(opacity = 255);new(188,143,143,opacity);end
  123. def self.indianred(opacity = 255);new(205,92,92,opacity);end
  124. def self.red(opacity = 255);new(255,0,0,opacity);end
  125. def self.brown(opacity = 255);new(165,42,42,opacity);end
  126. def self.firebrick(opacity = 255);new(178,34,34,opacity);end
  127. def self.darkred(opacity = 255);new(139,0,0,opacity);end
  128. def self.maroon(opacity = 255);new(128,0,0,opacity);end
  129. def self.white(opacity = 255);new(255,255,255,opacity);end
  130. def self.whitesmoke(opacity = 255);new(245,245,245,opacity);end
  131. def self.gainsboro(opacity = 255);new(220,220,220,opacity);end
  132. def self.lightgrey(opacity = 255);new(211,211,211,opacity);end
  133. def self.silver(opacity = 255);new(192,192,192,opacity);end
  134. def self.darkgray(opacity = 255);new(169,169,169,opacity);end
  135. def self.gray(opacity = 255);new(128,128,128,opacity);end
  136. def self.dimgray(opacity = 255);new(105,105,105,opacity);end
  137. def self.black(opacity = 255);new(0,0,0,opacity);end
  138. end

复制代码
[LINE]1,#dddddd[/LINE]版务信息:本贴由楼主自主结贴~
作者: ★_茄孓    时间: 2008-8-21 19:04
Color.lightpink
Color.pink
Color.crimson
Color.dimgray

Color.new(r,g,b,a)这个都可以替换以上Color.lightpink/Color.pink....


应该懂吧?
作者: horussakai    时间: 2008-8-21 19:10
晕,我说的不是使用方法,而是这段代码是替换原先的COLOR类,还是新生成在MAIN里的?


我不知道COLOR类是哪个脚本里的
作者: ★_茄孓    时间: 2008-8-21 19:15
....Color类你又看不到,,
直接放main前就可以了
而且里面全是新方法` [LINE]1,#dddddd[/LINE]系统信息:本贴获得楼主认可,66RPG感谢您的热情解答~
作者: horussakai    时间: 2008-8-21 19:22
噢,原来COLOR是内部类。。。。。。。。。不允许修改的啊。。。。。。。。。



那Color.pink这个能在对话脚本里使用吗?跟那个\c[x]使用方法一样?

比如\c[2]文字文字

可以写成Color.pink(255)文字文字


是这个意思?
作者: ★_茄孓    时间: 2008-8-21 19:24
这个不行。。需要在对话脚本里先设置好才给你用的
作者: horussakai    时间: 2008-8-21 19:36
Color.pink等这些那怎么用啊。。。。。。。。。。。。{/gg}可以在界面里直接写脚本调用吗?
作者: ★_茄孓    时间: 2008-8-21 20:08
是调用颜色的东西啊``
比如自动的颜色啊都可以用这些
作者: horussakai    时间: 2008-8-21 20:57
还是不明白,能写一句简单的脚本我看看怎么用吗?
作者: ★_茄孓    时间: 2008-8-21 21:00
在窗口里改变字体颜色
本来是
self.contents.font.color = Color.new(r,g,b,a)
你现在可以用
self.contents.font.color = Color.pink [LINE]1,#dddddd[/LINE]系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
作者: horussakai    时间: 2008-8-21 21:36
谢谢了,可惜不能用于对话。。。。。。。哎




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