#include <Button.h>
Public Member Functions | |
C2DButton () | |
Standard constructor. | |
bool | Init (HWND hWnd, RECT box, bool visible, bool enabled, WCHAR *caption, RECT textBox, LPDIRECT3DTEXTURE9 tex, LPDIRECT3DTEXTURE9 texOver, IDirectSound8 *pDS, LPWSTR clickSoundFilename, LPWSTR focusSoundFilename, int type) |
Initialize button object. | |
bool | OnEvent (UINT uMsg, WPARAM wParam, LPARAM lParam) |
OnEvent should handle events like mouse click and mouse over. For button to handle these events, button class must contain info about button position, size, etc. | |
void | OnRender (LPDIRECT3DDEVICE9 pd3dDevice, LPD3DXSPRITE pSprite, LPD3DXFONT pFont, D3DXVECTOR2 *scaling, D3DXVECTOR2 *trans, D3DXVECTOR2 *spriteCentre, float rotation) |
Render button on the screen (d3ddevice). 2D buttons are drawn on sprites. They have texture and caption. | |
void | OnFrameMove (LPDIRECT3DDEVICE9 pd3dDevice, float fElapsedTime) |
OnFrameMove defines button animation (if any). In this case, buttons are shaken when in focus. |
Represents 2D buttons with textures.
C2DButton::C2DButton | ( | ) |
Standard constructor.
bool C2DButton::Init | ( | HWND | hWnd, | |
RECT | box, | |||
bool | visible, | |||
bool | enabled, | |||
WCHAR * | caption, | |||
RECT | textBox, | |||
LPDIRECT3DTEXTURE9 | tex, | |||
LPDIRECT3DTEXTURE9 | texOver, | |||
IDirectSound8 * | pDS, | |||
LPWSTR | clickSoundFilename, | |||
LPWSTR | focusSoundFilename, | |||
int | type | |||
) |
Initialize button object.
type | MPE_BUTTON_TYPE enum variable. |
bool C2DButton::OnEvent | ( | UINT | uMsg, | |
WPARAM | wParam, | |||
LPARAM | lParam | |||
) | [virtual] |
OnEvent should handle events like mouse click and mouse over. For button to handle these events, button class must contain info about button position, size, etc.
Reimplemented from CButton.
void C2DButton::OnRender | ( | LPDIRECT3DDEVICE9 | pd3dDevice, | |
LPD3DXSPRITE | pSprite, | |||
LPD3DXFONT | pFont, | |||
D3DXVECTOR2 * | pScaling, | |||
D3DXVECTOR2 * | pTrans, | |||
D3DXVECTOR2 * | spriteCentre, | |||
float | rotation | |||
) |
Render button on the screen (d3ddevice). 2D buttons are drawn on sprites. They have texture and caption.
void C2DButton::OnFrameMove | ( | LPDIRECT3DDEVICE9 | pd3dDevice, | |
float | fElapsedTime | |||
) | [virtual] |
OnFrameMove defines button animation (if any). In this case, buttons are shaken when in focus.
Reimplemented from CButton.