0
我想創建簡單的GUI,將顯示基於單個領域的一些數據,用戶進入如何更新鞋(紅寶石)para.text
這是我用來顯示代碼數據
Shoes.app {
background "#EFC"
border("#BE8", strokewidth: 6)
stack(margin: 12) {
@here=para "Eneter your summoner name"
flow {
@sumName=edit_line
@push=button "Enter"
@push.click {
setup(@sumName.text)
}
}
}
#Champion Stats Table
flow{
$table = [[]]
i = 0
#Name
stack(:width => 100){
$table[i][0] = para "Champion", margin: 4
$Summoner.rankedChamps.each do |c|
$table[i][0] = para c.name, margin: 4
end
i+=1
}
i = 0
#Wins
stack(:width => 50){
$table[i][1] = para "Wins", margin: 4
$Summoner.rankedChamps.each do |c|
$table[i][1] = para c.wins.to_s, margin: 4
end
i+=1
}
i = 0
#Loses
stack(:width => 50){
$table[i][1] = para "Loses", margin: 4
$Summoner.rankedChamps.each do |c|
$table[i][2] = para c.loses.to_s, margin: 4
end
i+=1
}
i = 0
#KDA
stack(:width => 50){
$table[i][1] = para "KDA", margin: 4
$Summoner.rankedChamps.each do |c|
$table[i][3] = para c.KDA.to_s, margin: 4
end
i+=1
}
}
當用戶點擊確認按鈕的$Summoner
對象被正確地更新,但是我無法弄清楚如何更新所有對文本精密組件