Dxlibのウィンドウのボタンの処理・描画を管理するクラス.
[詳解]
#include <simple_button.h>
|
| SimpleButton ()=delete |
| デフォルトコンストラクタは生成できない.
|
|
| SimpleButton (const std::string &text, int x_pos, int y_pos, int x_size, int y_size, bool fit_size=false) |
| コンストラクタでボタンのテキスト,座標,サイズを受け取る.
|
|
| ~SimpleButton ()=default |
|
void | SetActivateFunction (const std::function< void()> &func) |
| ボタンがクリックされたときに実行される関数を設定する.
|
|
void | SetPos (int pos_x, int pos_y, unsigned int option=kDxlibGuiAnchorLeftTop) |
| ボタンの座標を設定する.
|
|
constexpr int | GetPosMiddleX () const noexcept |
| ボタンのx座標を取得する.
|
|
constexpr int | GetPosMiddleY () const noexcept |
| ボタンのy座標を取得する.
|
|
void | Update () override |
| GUIの更新,毎フレーム実行すること.
|
|
void | Draw () const override |
| GUIの描画.
|
|
void | SetVisible (bool visible) override |
| GUIの表示を行うかどうかを設定する.
|
|
bool | IsVisible () const override |
| GUIの表示を行うかどうかを返す.
|
|
void | ClickedAction (const DxlibMouseState &state) override |
| GUIがクリックされたときに実行される関数.
CursorOnGuiが true を返すときに呼び出される. 複数のGUIが重なっている場合は,優先度の高いものから順に呼び出される.
|
|
bool | CursorOnGui (int cursor_x, int cursor_y) const noexcept override |
| GUIの上にカーソルがあるかどうかを返す.
|
|
virtual | ~IDxlibGui ()=default |
|
virtual | ~IDxlibClickable ()=default |
|
Dxlibのウィンドウのボタンの処理・描画を管理するクラス.
simple_button.h の 24 行目に定義があります。
◆ SimpleButton() [1/2]
designlab::SimpleButton::SimpleButton |
( |
| ) |
|
|
delete |
◆ SimpleButton() [2/2]
designlab::SimpleButton::SimpleButton |
( |
const std::string & |
text, |
|
|
int |
x_pos, |
|
|
int |
y_pos, |
|
|
int |
x_size, |
|
|
int |
y_size, |
|
|
bool |
fit_size = false |
|
) |
| |
コンストラクタでボタンのテキスト,座標,サイズを受け取る.
- 引数
-
[in] | text | ボタンに書かれるテキスト. |
[in] | x_pos | ボタンのx座標.ボタンの中心座標. |
[in] | y_pos | ボタンのy座標.ボタンの中心座標. |
[in] | x_size | ボタンの横幅. |
[in] | y_size | ボタンの縦幅. |
[in] | fit_size | ボタンのサイズをテキストに合わせるかどうか. defaultでは false. |
simple_button.cpp の 23 行目に定義があります。
◆ ~SimpleButton()
designlab::SimpleButton::~SimpleButton |
( |
| ) |
|
|
default |
◆ ClickedAction()
void designlab::SimpleButton::ClickedAction |
( |
const DxlibMouseState & |
state | ) |
|
|
overridevirtual |
◆ CursorOnGui()
bool designlab::SimpleButton::CursorOnGui |
( |
int |
cursor_x, |
|
|
int |
cursor_y |
|
) |
| const |
|
overridevirtualnoexcept |
◆ Draw()
void designlab::SimpleButton::Draw |
( |
| ) |
const |
|
overridevirtual |
◆ GetPosMiddleX()
constexpr int designlab::SimpleButton::GetPosMiddleX |
( |
| ) |
const |
|
inlineconstexprnoexcept |
◆ GetPosMiddleY()
constexpr int designlab::SimpleButton::GetPosMiddleY |
( |
| ) |
const |
|
inlineconstexprnoexcept |
◆ IsVisible()
bool designlab::SimpleButton::IsVisible |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ SetActivateFunction()
void designlab::SimpleButton::SetActivateFunction |
( |
const std::function< void()> & |
func | ) |
|
|
inline |
ボタンがクリックされたときに実行される関数を設定する.
- 引数
-
[in] | func | ボタンがクリックされたときに実行される関数. |
simple_button.h の 45 行目に定義があります。
◆ SetPos()
ボタンの座標を設定する.
- 引数
-
[in] | pos_x | ボタンのx座標. |
[in] | pos_y | ボタンのy座標. |
[in] | option | ボタンのどの地点を起点に座標を設定するかを指定する. defaultでは左上を起点とする. |
simple_button.cpp の 37 行目に定義があります。
◆ SetVisible()
void designlab::SimpleButton::SetVisible |
( |
bool |
visible | ) |
|
|
inlineoverridevirtual |
◆ Update()
void designlab::SimpleButton::Update |
( |
| ) |
|
|
overridevirtual |
このクラス詳解は次のファイルから抽出されました: