Project1

标题: 怎样在ui设置时在同一区域显示不同的文字 [打印本页]

作者: 老王的忧郁    时间: 2015-9-9 02:27
标题: 怎样在ui设置时在同一区域显示不同的文字
本帖最后由 老王的忧郁 于 2015-9-11 16:33 编辑



  def draw_actor_meridian(actor, x, y)   
    # 定义数字颜色
    meridian = normal_color
    upcolor = Color.new(0, 200, 0, 255)
    self.contents.font.color = normal_color   
    self.contents.font.size = 16
    parameter_name = "剩余修为:"
      parameter_value = $meri_point
      if $meri_point != 0
        meridian = upcolor
      end
      if $game_switches[705] == true
        constitution_name = "天魔五行之體"
      elsif
        $game_switches[706] == true
        constitution_name = "太陰絕命之體"
      elsif
        $game_switches[707] == true
        constitution_name = "天孤萬治之體"
      elsif
        $game_switches[708] ==true
        constitution_name = "天極大聖之體"
      elsif
        $game_switches[709] == true
        constitution_name = "天極大聖之體"
      end
    self.contents.font.color = system_color
    self.contents.draw_text(x, y-10, 120, 32, parameter_name)
    self.contents.draw_text(x, y+5, 120, 32,"下一级:" )
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 100, y-10, 36, 32, parameter_value.to_s)  
    self.contents.draw_text(x + 100, y+5, 36, 32, $game_variables[183].to_s)
    self.contents.font.color = text_color(3)
    self.contents.draw_text(x, y+20, 120, 32, "根骨:")
    self.contents.draw_text(x + 100, y+20, 36, 32, $game_variables[176].to_s)
    self.contents.font.color = meridian
    #self.contents.draw_text(x + 180, y, 60, 32, parameter_value_temp.to_s)
    #self.contents.font.color = normal_color
    self.contents.draw_text(x-100, y-9, 120, 32,"體      質" )
    self.contents.font.color = normal_color
    self.contents.draw_text(x-100, y+10, 120, 32,"constitution_name")  
    end
  end

我写了这样一段代码,经过   喵呜喵5    大人的提示之后,就可以显示出正确的根据体质开关来决定
不同体质,不同【筋脉】升级需求不同的经验的脚本了
作者: 喵呜喵5    时间: 2015-9-9 07:19
使用 == 来判断开关是否打开,一个等号是赋值,不是判断
作者: 冷峻逸    时间: 2015-9-9 13:21
提示: 作者被禁止或删除 内容自动屏蔽
作者: 老王的忧郁    时间: 2015-9-9 14:00
冷峻逸 发表于 2015-9-9 13:21
补充一下,if的语法规则是在其后面的为真则执行,判断符号会返回布朗值
ruby和c之类也有些不同,只要数值不 ...

因为楼主是这个脚本渣,基础知识很渣
作者: 老王的忧郁    时间: 2015-9-9 14:05
喵呜喵5 发表于 2015-9-9 07:19
使用 == 来判断开关是否打开,一个等号是赋值,不是判断

因为这几个开关关系到,经脉系统。用开关来控制不同体质的需要不一样的点经脉的修为需求。
写了这个段之后,还会导致开关的主要效果失效,无法调节经脉的修为需求···········




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