テキストボタンのテキストを中央ではなく左 (または右) に揃える方法はありますか? 探したのですが、なかなか見つからないようです。.json スキン ファイルでできることはありますか。
ありがとう、私が不正確だったら教えてください:)
はい、テキストをボタンの左側に揃えることができます。例を参照してください。
someButton.getLabel().setAlignment(Align.left);
基本的に、ボタンのラベルをボタンの内側の左側に揃える必要があります。明らかに、右、上、下の配置などについても同じことができます。
これも「ラベル位置の調整」と同じことを行います。
Skin theSkin= new Skin();
//Create a button style
TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle();
textButtonStyle.pressedOffsetY=-4.0f;
textButtonStyle.unpressedOffsetY=-4.0f;
theSkin.add("default", textButtonStyle);
TextButton theButton = new TextButton("New",theSkin);