SDXFrameWork  0.09
SDXFrameWork
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
SDX::Joypad Class Reference

ジョイパッドの状態を表すクラス. More...

#include <Joypad.h>

Public Member Functions

void Open ()
 
void Make (PadType パッドタイプ)
 パッドの作成. More...
 
void Reset ()
 状態のリセット. More...
 
void Update ()
 状態の更新. More...
 
PadType GetInputType ()
 パッドタイプの取得. More...
 
void SetInputType (PadType 入力タイプ)
 パッドタイプの設定. More...
 
bool StartVibration (double 強さ, int 振動ミリ秒)
 パッドを振動させる[未実装]. More...
 
bool StopVibration ()
 パッドの振動を停止する[未実装]. More...
 

Static Public Member Functions

static int GetCount ()
 接続中のパッド数を取得. More...
 

Public Attributes

int StickX = 0
 
int StickY = 0
 
bool press [32]
 
Key Down
 
Key Left
 
Key Right
 
Key Up
 
Key Button1
 
Key Button2
 
Key Button3
 
Key Button4
 
Key Button5
 
Key Button6
 
Key Button7
 
Key Button8
 
Key Button9
 
Key Button10
 
Key Button11
 
Key Button12
 
Key Button13
 
Key Button14
 
Key Button15
 
Key Button16
 
Key Button17
 
Key Button18
 
Key Button19
 
Key Button20
 
Key Button21
 
Key Button22
 
Key Button23
 
Key Button24
 
Key Button25
 
Key Button26
 
Key Button27
 
Key Button28
 

Detailed Description

ジョイパッドの状態を表すクラス.

//©SDXFramework http://sourceforge.jp/projects/dxframework/
//🍣入力を取得する
bool SampleInput()
{
using namespace SDX;
System::Initialise("sample", 600, 400);
std::string message = "";
while (System::Update())
{
if (Input::mouse.Left.on) message = "クリックした";
if (Input::mouse.Left.off) message = "離した";
if (Input::key.Z.hold ) message = "Zを押している";
if (Input::key.Z.holdCount > 60 ) message = "Zを長押し";
//マウスの位置に文字を描画
Drawing::String({ Input::mouse.x, Input::mouse.y }, Color::White, message.c_str());
if (Input::key.Return.on) break;//Enterで終了
}
return true;
}

Member Function Documentation

void SDX::Joypad::Make ( PadType  パッドタイプ)

パッドの作成.

void SDX::Joypad::Reset ( )

状態のリセット.

void SDX::Joypad::Update ( )

状態の更新.

PadType SDX::Joypad::GetInputType ( )

パッドタイプの取得.

void SDX::Joypad::SetInputType ( PadType  入力タイプ)

パッドタイプの設定.

bool SDX::Joypad::StartVibration ( double  強さ,
int  振動ミリ秒 
)

パッドを振動させる[未実装].

指定した強さ(0.0~1.0)で指定ミリ秒パッドを振動させる
時間が-1の場合、StopVibration関数を呼ぶまで振動させる

bool SDX::Joypad::StopVibration ( )

パッドの振動を停止する[未実装].

static int SDX::Joypad::GetCount ( )
static

接続中のパッド数を取得.