Mercurial > LightClone
diff LightClone/Source/Dialog.h @ 41:a986355cca5f
Move Tower structure into Environment
author | koryspansel |
---|---|
date | Thu, 22 Sep 2011 10:25:35 -0700 |
parents | 00d17d8f407d |
children | 6790cf9e8bd8 |
line wrap: on
line diff
--- a/LightClone/Source/Dialog.h Thu Sep 22 10:21:14 2011 -0700 +++ b/LightClone/Source/Dialog.h Thu Sep 22 10:25:35 2011 -0700 @@ -62,7 +62,6 @@ if(eCode == Error_Success) { SetTexture("Data\\Textures\\Dialog0.tga", true); - //SetDimensions(300.0f, 200.0f); kLabel.Initialize(pResourceManager); kLabel.SetPosition(0.5f * kDimensions.x, 0.15f * kDimensions.y); @@ -82,16 +81,8 @@ kButton[i].SetColor(D3DCOLOR_XRGB(0, 0, 0)); kButton[i].Subscribe(GuiButton::EventClick, &Dialog::OnClick, this); - const D3DXVECTOR2& kButtonSize = kButton[i].GetDimensions(); - - //x = 0.5 * Wb - //1 = 0.5 * Wd - x - //2 = 0.25 * Wd - x; 0.75 * Wd - x - - const float fScale = 1.0f / (float)(ButtonCount + 1); - - const float fX = (i + 1) * fScale * kDimensions.x - 0.5f * kButtonSize.x; - const float fY = 0.65f * kDimensions.y; + const float fX = ((i + 1) * kDimensions.x / (float)(ButtonCount + 1)) - 0.5f * kButton[i].GetDimensions().x; + const float fY = 0.65f * kDimensions.y; kButton[i].SetPosition(fX, fY);