/*---------------------------------------------------------------------------* Project: NintendoWare File: SmButton.h Copyright (C)2009-2011 Nintendo/HAL Laboratory, Inc. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo and/or its licensed developers and are protected by national and international copyright laws. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. The content herein is highly confidential and should be handled accordingly. $Revision: $ *---------------------------------------------------------------------------*/ #ifndef SM_BUTTON_H_ #define SM_BUTTON_H_ #include "../include/SmPrimitive.h" #include "../include/SmMessage.h" #include "../include/SmRectCollision.h" //------------------------------------------------------------------------------ // ボタンクラス class SmButton : public SmMessage { public: // コンストラクタ SmButton( uint x, uint y, uint w, uint h ); // デストラクタ ~SmButton(); // メッセージ受信 virtual bool ReceveMessage( SmMessageType type, void* object, uint targetId ); // 描画 virtual void Render(); // ボタン状態を設定する void SetSwitch( bool bswitch ); // ボタン状態をスワップする void SwapSwitch(); // スイッチオンオフ状態を取得する bool IsSwitch() { return m_IsSwitch; } // ボタンカラーを設定する void SetColor( nw::ut::Color8 onColor, nw::ut::Color8 offColor ); private: Sm2DPrimPC* m_Button; Sm2DPrimPC* m_PushButton; u16 m_LastX; u16 m_LastY; SmRectCollision m_Collision; bool m_IsPressed; bool m_IsGrab; bool m_IsSwitch; nw::ut::Color8 m_OnColor; nw::ut::Color8 m_OffColor; }; #endif // SM_BUTTON_H_