SDXFrameWork  0.07
SDXFrameWork
 全て クラス ネームスペース 関数 変数 列挙型 列挙型の値 ページ
Public メソッド | Static Public メソッド | Public 変数 | すべてのメンバ一覧
クラス SDX::Joypad

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

#include <Joypad.h>

Public メソッド

void Open ()
 
void Make (PadType パッドタイプ)
 パッドの作成. [詳細]
 
void Reset ()
 状態のリセット. [詳細]
 
void Update ()
 状態の更新. [詳細]
 
PadType GetInputType ()
 パッドタイプの取得. [詳細]
 
void SetInputType (PadType 入力タイプ)
 パッドタイプの設定. [詳細]
 
bool SetInputToKey (PadCode padInput, KeyCode keyInput1, KeyCode keyInput2, KeyCode keyInput3, KeyCode keyInput4)
 キー割り当て追加[DXLIB]. [詳細]
 
bool StartVibration (double 強さ, int 振動ミリ秒)
 パッドを振動させる[DXLIB]. [詳細]
 
bool StopVibration ()
 パッドの振動を停止する[DXLIB]. [詳細]
 

Static Public メソッド

static int GetCount ()
 接続中のパッド数を取得. [詳細]
 

Public 変数

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
 

説明

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

//入力を取得する
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;
}

関数

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::SetInputToKey ( PadCode  padInput,
KeyCode  keyInput1,
KeyCode  keyInput2,
KeyCode  keyInput3,
KeyCode  keyInput4 
)

キー割り当て追加[DXLIB].

第二引数以降のキーが押された時、指定したパッドのボタンを押されたと判定する

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

パッドを振動させる[DXLIB].

指定した強さ(0.0~1.0)で指定ミリ秒パッドを振動させる\n

時間が-1の場合、StopVibration関数を呼ぶまで振動させる

bool SDX::Joypad::StopVibration ( )

パッドの振動を停止する[DXLIB].

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

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