DirectX ライブラリの単純なボタンのフォント サイズを変更する方法。
私は以下のように推測していますが、うまくいきませんでした;
CDXUTDialog g_SampleUI;
g_SampleUI.AddButton( IDC_BUTTON_X2_Y2, L"8", (iX + (2*len)), iY, len, len );
g_SampleUI.SetFont( IDC_BUTTON_X2_Y2, L"Arial", 32, FW_BOLD );
DirectX ライブラリの単純なボタンのフォント サイズを変更する方法。
私は以下のように推測していますが、うまくいきませんでした;
CDXUTDialog g_SampleUI;
g_SampleUI.AddButton( IDC_BUTTON_X2_Y2, L"8", (iX + (2*len)), iY, len, len );
g_SampleUI.SetFont( IDC_BUTTON_X2_Y2, L"Arial", 32, FW_BOLD );
このCDXUTDialog::SetFont
メソッドは、あなたが想定しているように、最初の引数としてID を取りません。
ボタンのフォントをこのように設定すると、より理にかなっています (テストされていません)。
g_SampleUI.SetFont(1, L"Arial", 32, FW_BOLD);
CDXUTButton *button = g_SampleUI.GetButton(IDC_BUTTON_X2_Y2);
CDXUTElement *elem = button->GetElement(1); // ..or perhaps GetElement(0)
elem->SetFont(1); // Set the font for this element to font 1 that we created on
// the first line
g_SampleUI.Refresh();