MGL(Win32)
読み取り中…
検索中…
一致する文字列を見つけられません
mgl_input_bounds.h
[詳解]
1// SPDX-License-Identifier: Zlib
2/* ------------------------------------------------------------------------- */
9/* ------------------------------------------------------------------------- */
10
11#ifndef INCGUARD_MGL_INPUT_BOUNDS_H_1609478669
12#define INCGUARD_MGL_INPUT_BOUNDS_H_1609478669
13
16
17namespace MGL::Input
18{
21{
22public:
23 InputBounds() noexcept;
24
25 /* ------------------------------------------------------------------------- */
31 /* ------------------------------------------------------------------------- */
32 [[nodiscard]] constexpr bool IsValid() const noexcept
33 {
34 return ((_bounds.width > 0.0f) && (_bounds.height > 0.0f));
35 }
36
37 void Set(const Rectangle &bounds) noexcept;
38 void SetWithLogicalSize(const Rectangle &bounds, const Vector2 &logicalSize) noexcept;
39 void SetWithScale(const Rectangle &bounds, const Vector2 &scale) noexcept;
40
41 [[nodiscard]] Vector2 GetPosition(const Vector2 &position) const noexcept;
42
43private:
44 Rectangle _bounds;
45 Vector2 _scale;
46};
47} // namespace MGL::Input
48
49#endif // INCGUARD_MGL_INPUT_BOUNDS_H_1609478669
50
51// vim: et ts=4 sw=4 sts=4
MGL 入力範囲
Definition mgl_input_bounds.h:21
void SetWithLogicalSize(const Rectangle &bounds, const Vector2 &logicalSize) noexcept
範囲を論理サイズ指定で設定
Definition mgl_input_bounds.cc:46
void SetWithScale(const Rectangle &bounds, const Vector2 &scale) noexcept
範囲をスケール指定で設定
Definition mgl_input_bounds.cc:68
constexpr bool IsValid() const noexcept
この範囲が有効かを取得
Definition mgl_input_bounds.h:32
InputBounds() noexcept
コンストラクタ
Definition mgl_input_bounds.cc:20
void Set(const Rectangle &bounds) noexcept
範囲を設定
Definition mgl_input_bounds.cc:32
Vector2 GetPosition(const Vector2 &position) const noexcept
座標から範囲内の座標を取得
Definition mgl_input_bounds.cc:82
MGL 矩形
MGL 2Dベクトル
矩形
Definition mgl_rectangle.h:20
float width
Definition mgl_rectangle.h:23
float height
高さ
Definition mgl_rectangle.h:24
2Dベクトル
Definition mgl_vector2.h:23