1 /*---------------------------------------------------------------------------*
2   Project:  NintendoWare
3   File:     SmBUtton.h
4 
5   Copyright (C)2009-2010 Nintendo Co., Ltd./HAL Laboratory, Inc.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Revision: 1 $
14  *---------------------------------------------------------------------------*/
15 #ifndef SM_BUTTON_H_
16 #define SM_BUTTON_H_
17 
18 #include "../include/SmPrimitive.h"
19 #include "../include/SmMessage.h"
20 #include "../include/SmRectCollision.h"
21 
22 //------------------------------------------------------------------------------
23 // �{�^���N���X
24 class SmButton : public SmMessage
25 {
26 public:
27     // �R���X�g���N�^
28     SmButton( uint x, uint y, uint w, uint h );
29 
30     // �f�X�g���N�^
31     ~SmButton();
32 
33     // ���b�Z�[�W��M
34     virtual bool ReceveMessage( SmMessageType type, void* object, uint targetId );
35 
36     // �`��
37     virtual void Render();
38 
39     // �{�^����Ԃ�ݒ肷��
40     void SetSwitch( bool bswitch );
41 
42     // �{�^����Ԃ��X���b�v����
43     void SwapSwitch();
44 
45     // �X�C�b�`�I���I�t��Ԃ��擾����
IsSwitch()46     bool IsSwitch()
47     {
48         return m_IsSwitch;
49     }
50 
51     // �{�^���J���[��ݒ肷��
52     void SetColor( nw::ut::Color8 onColor, nw::ut::Color8 offColor );
53 
54 private:
55     Sm2DPrimPC*         m_Button;
56     Sm2DPrimPC*         m_PushButton;
57 
58     u16                 m_LastX;
59     u16                 m_LastY;
60 
61     SmRectCollision     m_Collision;
62 
63     bool                m_IsPressed;
64     bool                m_IsGrab;
65     bool                m_IsSwitch;
66 
67     nw::ut::Color8      m_OnColor;
68     nw::ut::Color8      m_OffColor;
69 };
70 
71 
72 
73 
74 #endif  // SM_BUTTON_H_
75