2
在我的libGdx
項目中,我使用.json
文件來設置屬性對話框的按鈕樣式。我有兩個按鈕:紅色(OFF)和綠色(ON)。如何使用JSON更改LibGDX中屬性對話框的樣式?
我想在它們之間切換。有沒有在JSON
文件中設置樣式的方法?
com.badlogic.gdx.scenes.scene2d.ui.TextButton$TextButtonStyle: {
default: { down: ON_Button, up: ON_Button, font: default-font, fontColor: white },
toggle: { down: ON_Button, up: ON_Button, checked: OFF_Button, font: default-font, fontColor: white, downFontColor: red }
},
不應該這是切換而不是默認?我並不十分了解JSON和這種風格,但儘管我瞭解他正在尋找的風格應該稱爲切換(這不是技術方面的命名)。他的JSON文件是正確的嗎? – Springrbua
@Springrbua,是的,這種風格應該命名爲「複選框」或「切換」或類似的東西。另外,'TextButtonStyle'只需要'font'字段,所以,是的,看起來是正確的。 – desertkun
謝謝。直到現在,我並不需要這個在我的遊戲中,因爲我沒有菜單,但是當我執行菜單時,這個信息將有助於希望:P謝謝。 +1 – Springrbua