Class: Miyako::InitiativeYuki::Command
- Defined in:
- lib/Miyako/API/i_yuki.rb,
lib/Miyako/API/i_yuki.rb
Overview
コマンド構造体
- body
-
コマンドの名称(移動する、調べるなど、アイコンなどの画像も可)
- body_selected
-
選択時コマンドの名称(移動する、調べるなど、アイコンなどの画像も可)(省略時は、bodyと同一)
- condition
-
表示条件(ブロック)。評価の結果、trueのときのみ表示
- result
-
選択結果(移動先シーンクラス名、シナリオ(メソッド)名他のオブジェクト)
- body_disable
-
選択不可時コマンドの名称(移動する、調べるなど、アイコンなどの画像も可)(省略時は、bodyと同一)
- enabe
-
コマンド選択の時はtrue、選択不可の時はfalseを設定
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#body_disable ⇒ Object
Returns the value of attribute body_disable.
-
#body_selected ⇒ Object
Returns the value of attribute body_selected.
-
#condition ⇒ Object
Returns the value of attribute condition.
-
#enable ⇒ Object
Returns the value of attribute enable.
-
#result ⇒ Object
Returns the value of attribute result.
Instance Method Summary collapse
-
#to_choice(font = Font.sans_serif, size = 16, color = Color[:white]) ⇒ Object
Command構造体をChoice構造体に変換する.
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body
87 88 89 |
# File 'lib/Miyako/API/i_yuki.rb', line 87 def body @body end |
#body_disable ⇒ Object
Returns the value of attribute body_disable
87 88 89 |
# File 'lib/Miyako/API/i_yuki.rb', line 87 def body_disable @body_disable end |
#body_selected ⇒ Object
Returns the value of attribute body_selected
87 88 89 |
# File 'lib/Miyako/API/i_yuki.rb', line 87 def body_selected @body_selected end |
#condition ⇒ Object
Returns the value of attribute condition
87 88 89 |
# File 'lib/Miyako/API/i_yuki.rb', line 87 def condition @condition end |
#enable ⇒ Object
Returns the value of attribute enable
87 88 89 |
# File 'lib/Miyako/API/i_yuki.rb', line 87 def enable @enable end |
#result ⇒ Object
Returns the value of attribute result
87 88 89 |
# File 'lib/Miyako/API/i_yuki.rb', line 87 def result @result end |
Instance Method Details
#to_choice(font = Font.sans_serif, size = 16, color = Color[:white]) ⇒ Object
Command構造体をChoice構造体に変換する
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/Miyako/API/i_yuki.rb', line 91 def to_choice(font=Font.sans_serif, size=16, color=Color[:white]) org_font_color = font.color org_font_size = font.size font.color = color tmp = self[:body] body = tmp.method(:to_sprite).arity == 0 ? tmp.to_sprite : tmp.to_sprite(font) font.color = Color[:red] tmp = self[:body_selected] body_selected = tmp ? (tmp.method(:to_sprite).arity == 0 ? tmp.to_sprite : tmp.to_sprite(font)) : body font.color = Color[:dark_gray] tmp = self[:body_disable] body_disable= tmp ? (tmp.method(:to_sprite).arity == 0 ? tmp.to_sprite : tmp.to_sprite(font)) : body cond = self[:condition] || ALL_TRUE choice = Choice.new(body, body_selected, body_disable, cond, self[:enable], false, self[:result], nil, nil, nil, nil, nil, {}, lambda{}, nil) choice.left = choice choice.right = choice choice.up = choice choice.down = choice choice.name = choice.__id__.to_s font.color = org_font_color font.size = org_font_size choice end |