SDXFrameWork  0.13
SDXFrameWork
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
Public Member Functions | Public Attributes | Friends | List of all members
SDX::Mouse Class Reference

マウスの状態を表すクラス. More...

#include <Mouse.h>

Public Member Functions

void Reset ()
 状態のリセット. More...
 
void Update ()
 状態の更新. More...
 
bool SetVisible (bool 表示フラグ)
 カーソルの表示設定. More...
 
bool SetPoint (int 移動先X, int 移動先Y)
 カーソル位置を移動. More...
 
Point GetPoint ()
 カーソル位置を取得. More...
 
Keyoperator[] (MouseCode index)
 MouseCodeでアクセス. More...
 

Public Attributes

int x = 0
 現在座標
 
int y = 0
 現在座標
 
int moveX = 0
 直前の座標からの移動量
 
int moveY = 0
 直前の座標からの移動量
 
int Whell = 0
 マウスの回転量
 
Key Left
 左クリック
 
Key Right
 右クリック
 
Key Middle
 マウスホイールクリック
 
Key Button4
 4ボタン
 
Key Button5
 5ボタン
 
Key Button6
 6ボタン
 
Key Button7
 7ボタン
 
Key Button8
 8ボタン
 

Friends

class Input
 

Detailed Description

マウスの状態を表すクラス.

//Copyright © 2014 SDXFramework
//[License]GNU Affero General Public License, version 3
//[Contact]http://sourceforge.jp/projects/dxframework/
//入力を取得する
bool SampleInput()
{
using namespace SDX;
System::Initialise("sample", 640, 480);
std::string message = "クリックするかZキーを押して";
while (System::Update())
{
if (Input::mouse.Left.on){ message = "クリックした"; }
if (Input::mouse.Left.off){ message = "離した"; }
if (Input::key[KeyCode::Z].hold){ message = "Zを押している"; }//列挙子でのキー指定も可能
if (Input::key.Z.holdCount > 60){ message = "Zを長押し"; }
//マウスの位置に文字を描画
if (Input::key.Return.on){ break;}//Enterで終了
}
return true;
}

Member Function Documentation

void SDX::Mouse::Reset ( )
inline

状態のリセット.

void SDX::Mouse::Update ( )
inline

状態の更新.

bool SDX::Mouse::SetVisible ( bool  表示フラグ)
inline

カーソルの表示設定.

bool SDX::Mouse::SetPoint ( int  移動先X,
int  移動先Y 
)
inline

カーソル位置を移動.

Point SDX::Mouse::GetPoint ( )
inline

カーソル位置を取得.

Key& SDX::Mouse::operator[] ( MouseCode  index)
inline

MouseCodeでアクセス.

MouseCode::COUNTや範囲外の場合Leftを返す