/*---------------------------------------------------------------------------* Project: NintendoWare File: SmSliderBar.h Copyright (C)2009-2010 Nintendo Co., Ltd./HAL Laboratory, Inc. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. 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. $Revision: 1 $ *---------------------------------------------------------------------------*/ #ifndef SM_SLIDERBAR_H_ #define SM_SLIDERBAR_H_ #include #include "../include/SmPrimitive.h" #include "../include/SmMessage.h" #include "../include/SmRectCollision.h" #include "../include/SmCommandUtility.h" //------------------------------------------------------------------------------ // スライダーバーを表示するクラス class SmSliderBar : public SmMessage { public: // タイプ enum { SM_SLIDER_BAR_VERTICAL = 0, // 垂直 SM_SLIDER_BAR_HORAIZON = 1 // 水平 }; typedef u32 SmSliderBarType; // コンストラクタ SmSliderBar( uint x, uint y, uint length, SmSliderBarType type ); // デストラクタ ~SmSliderBar(); // メッセージ受信 virtual bool ReceveMessage( SmMessageType type, void* object, uint targetId ); // 描画 virtual void Render(); // 0.f ~ 1.f f32 GetSliderParam() { // return m_OffsetY; return static_cast(m_OffsetY)/m_Length; } private: SmSliderBarType m_SliderType; Sm2DPrimPC* m_Bar; Sm2DPrimPC* m_Slider; SmRectCollision m_Collision; uint m_Length; bool m_IsGrab; s32 m_BaseX; s32 m_BaseY; s32 m_GrabX; s32 m_GrabY; s32 m_OffsetX; s32 m_OffsetY; s32 m_PreOffsetX; s32 m_PreOffsetY; SmCommandReuser m_BarCmd; }; #endif // SM_SLIDERBAR_H_