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

キーやマウスによる入力をまとめて管理するクラス. [詳細]

#include <Input.h>

Static Public メソッド

static void Reset ()
 状態をリセット. [詳細]
 
static void Update ()
 状態を更新. [詳細]
 
static void GetState (SDL_Event &event)
 入力の状態を更新[SDL]. [詳細]
 
static bool Text (int X座標, int Y座標, int 最大文字数, char *初期文字列, bool Escキャンセルフラグ, bool 1バイト文字限定フラグ=false)
 処理を停止してキーボードから文字を入力[DXLIB]. [詳細]
 
static int Number (int X座標, int Y座標, int 最小値, int 最大値, int Escキャンセルフラグ)
 キーボードから数字を入力[DXLIB]. [詳細]
 
static bool StartTextMode (int 最大文字数, bool ESCキャンセル可能フラグ, bool 半角文字限定フラグ, bool 数値入力限定フラグ)
 テキスト入力モードの開始[DXLIB]. [詳細]
 
static int CheckText ()
 テキスト入力モードの確認[DXLIB]. [詳細]
 
static bool DrawText (int X座標, int Y座標)
 テキストの描画[DXLIB]. [詳細]
 
static bool SetText (const char *文字列)
 テキストの設定[DXLIB]. [詳細]
 
static bool SetText (int 数値)
 テキストの設定[DXLIB]. [詳細]
 
static bool GetText (char *出力バッファ)
 テキストの取得[DXLIB]. [詳細]
 
static int SetKeyColor (int 入力文字色, int IME非使用時カーソル色, int IME使用時文字色, int IME使用時カーソル色, int 変換時下線色, int IME使用時変換候補色, int 入力モード名色, int 入力文字縁色, int 変換候補縁色, int 入力モード名縁色, int 変換候補ウィンドウ縁色, int 変換候補ウィンドウ色)
 キーボード入力時の表示色設定[DXLIB]. [詳細]
 

Static Public 変数

static Joypad pad
 
static Mouse mouse
 
static Keyboard key
 
static Touch touch [10]
 
static Gesture gesture
 

説明

キーやマウスによる入力をまとめて管理するクラス.

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

関数

static void SDX::Input::Reset ( )
static

状態をリセット.

static void SDX::Input::Update ( )
static

状態を更新.

static void SDX::Input::GetState ( SDL_Event &  event)
static

入力の状態を更新[SDL].

static bool SDX::Input::Text ( int  X座標,
int  Y座標,
int  最大文字数,
char *  初期文字列,
bool  Escキャンセルフラグ,
bool  1バイト文字限定フラグ = false 
)
static

処理を停止してキーボードから文字を入力[DXLIB].

static int SDX::Input::Number ( int  X座標,
int  Y座標,
int  最小値,
int  最大値,
int  Escキャンセルフラグ 
)
static

キーボードから数字を入力[DXLIB].

数値入力ウィンドウを表示する
入力中は全ての処理が停止する
入力した値を返す、失敗した場合、範囲外の数値を返す

static bool SDX::Input::StartTextMode ( int  最大文字数,
bool  ESCキャンセル可能フラグ,
bool  半角文字限定フラグ,
bool  数値入力限定フラグ 
)
static

テキスト入力モードの開始[DXLIB].

他の処理を止めずに文字入力を行う

static int SDX::Input::CheckText ( )
static

テキスト入力モードの確認[DXLIB].

static bool SDX::Input::DrawText ( int  X座標,
int  Y座標 
)
static

テキストの描画[DXLIB].

static bool SDX::Input::SetText ( const char *  文字列)
static

テキストの設定[DXLIB].

static bool SDX::Input::SetText ( int  数値)
static

テキストの設定[DXLIB].

static bool SDX::Input::GetText ( char *  出力バッファ)
static

テキストの取得[DXLIB].

static int SDX::Input::SetKeyColor ( int  入力文字色,
int  IME非使用時カーソル色,
int  IME使用時文字色,
int  IME使用時カーソル色,
int  変換時下線色,
int  IME使用時変換候補色,
int  入力モード名色,
int  入力文字縁色,
int  変換候補縁色,
int  入力モード名縁色,
int  変換候補ウィンドウ縁色,
int  変換候補ウィンドウ色 
)
static

キーボード入力時の表示色設定[DXLIB].