Skip to content

Commit

Permalink
[共通] PutText オーバーロード追加 #1159
Browse files Browse the repository at this point in the history
  • Loading branch information
Reputeless committed Dec 10, 2023
1 parent d1c8358 commit 86dbf46
Show file tree
Hide file tree
Showing 2 changed files with 242 additions and 0 deletions.
122 changes: 122 additions & 0 deletions Siv3D/include/Siv3D/PutText.hpp
Expand Up @@ -17,57 +17,179 @@

namespace s3d
{
/// @brief 指定した位置にテキストを描画します。
/// @param s テキスト
/// @param x 描画する中心の X 座標
/// @param y 描画する中心の Y 座標
void PutText(const char32* s, double x, double y);

/// @brief 指定した位置にテキストを描画します。
/// @param s テキスト
/// @param x 描画する中心の X 座標
/// @param y 描画する中心の Y 座標
void PutText(StringView s, double x, double y);

/// @brief 指定した位置にテキストを描画します。
/// @param s テキスト
/// @param x 描画する中心の X 座標
/// @param y 描画する中心の Y 座標
void PutText(String s, double x, double y);


/// @brief 指定した位置にテキストを描画します。
/// @param s テキスト
/// @param center 描画する中心座標
void PutText(const char32* s, Vec2 center);

/// @brief 指定した位置にテキストを描画します。
/// @param s テキスト
/// @param center 描画する中心座標
void PutText(StringView s, Vec2 center);

/// @brief 指定した位置にテキストを描画します。
/// @param s テキスト
/// @param center 描画する中心座標
void PutText(String s, Vec2 center);


/// @brief 指定した位置にテキストを描画します。
/// @param s テキスト
/// @param topLeft 描画する左上の座標
void PutText(const char32* s, Arg::topLeft_<Vec2> topLeft);

/// @brief 指定した位置にテキストを描画します。
/// @param s テキスト
/// @param topLeft 描画する左上の座標
void PutText(StringView s, Arg::topLeft_<Vec2> topLeft);

/// @brief 指定した位置にテキストを描画します。
/// @param s テキスト
/// @param topLeft 描画する左上の座標
void PutText(String s, Arg::topLeft_<Vec2> topLeft);


/// @brief 指定した位置にテキストを描画します。
/// @param s テキスト
/// @param topCenter 描画する上辺中心の座標
void PutText(const char32* s, Arg::topCenter_<Vec2> topCenter);

/// @brief 指定した位置にテキストを描画します。
/// @param s テキスト
/// @param topCenter 描画する上辺中心の座標
void PutText(StringView s, Arg::topCenter_<Vec2> topCenter);

/// @brief 指定した位置にテキストを描画します。
/// @param s テキスト
/// @param topCenter 描画する上辺中心の座標
void PutText(String s, Arg::topCenter_<Vec2> topCenter);


/// @brief 指定した位置にテキストを描画します。
/// @param s テキスト
/// @param topRight 描画する右上の座標
void PutText(const char32* s, Arg::topRight_<Vec2> topRight);

/// @brief 指定した位置にテキストを描画します。
/// @param s テキスト
/// @param topRight 描画する右上の座標
void PutText(StringView s, Arg::topRight_<Vec2> topRight);

/// @brief 指定した位置にテキストを描画します。
/// @param s テキスト
/// @param topRight 描画する右上の座標
void PutText(String s, Arg::topRight_<Vec2> topRight);


/// @brief 指定した位置にテキストを描画します。
/// @param s テキスト
/// @param rightCenter 描画する右辺中心の座標
void PutText(const char32* s, Arg::rightCenter_<Vec2> rightCenter);

/// @brief 指定した位置にテキストを描画します。
/// @param s テキスト
/// @param rightCenter 描画する右辺中心の座標
void PutText(StringView s, Arg::rightCenter_<Vec2> rightCenter);

/// @brief 指定した位置にテキストを描画します。
/// @param s テキスト
/// @param rightCenter 描画する右辺中心の座標
void PutText(String s, Arg::rightCenter_<Vec2> rightCenter);


/// @brief 指定した位置にテキストを描画します。
/// @param s テキスト
/// @param bottomRight 描画する右下の座標
void PutText(const char32* s, Arg::bottomRight_<Vec2> bottomRight);

/// @brief 指定した位置にテキストを描画します。
/// @param s テキスト
/// @param bottomRight 描画する右下の座標
void PutText(StringView s, Arg::bottomRight_<Vec2> bottomRight);

/// @brief 指定した位置にテキストを描画します。
/// @param s テキスト
/// @param bottomRight 描画する右下の座標
void PutText(String s, Arg::bottomRight_<Vec2> bottomRight);


/// @brief 指定した位置にテキストを描画します。
/// @param s テキスト
/// @param bottomCenter 描画する下辺中心の座標
void PutText(const char32* s, Arg::bottomCenter_<Vec2> bottomCenter);

/// @brief 指定した位置にテキストを描画します。
/// @param s テキスト
/// @param bottomCenter 描画する下辺中心の座標
void PutText(StringView s, Arg::bottomCenter_<Vec2> bottomCenter);

/// @brief 指定した位置にテキストを描画します。
/// @param s テキスト
/// @param bottomCenter 描画する下辺中心の座標
void PutText(String s, Arg::bottomCenter_<Vec2> bottomCenter);


/// @brief 指定した位置にテキストを描画します。
/// @param s テキスト
/// @param bottomLeft 描画する左下の座標
void PutText(const char32* s, Arg::bottomLeft_<Vec2> bottomLeft);

/// @brief 指定した位置にテキストを描画します。
/// @param s テキスト
/// @param bottomLeft 描画する左下の座標
void PutText(StringView s, Arg::bottomLeft_<Vec2> bottomLeft);

/// @brief 指定した位置にテキストを描画します。
/// @param s テキスト
/// @param bottomLeft 描画する左下の座標
void PutText(String s, Arg::bottomLeft_<Vec2> bottomLeft);


/// @brief 指定した位置にテキストを描画します。
/// @param s テキスト
/// @param leftCenter 描画する左辺中心の座標
void PutText(const char32* s, Arg::leftCenter_<Vec2> leftCenter);

/// @brief 指定した位置にテキストを描画します。
/// @param s テキスト
/// @param leftCenter 描画する左辺中心の座標
void PutText(StringView s, Arg::leftCenter_<Vec2> leftCenter);

/// @brief 指定した位置にテキストを描画します。
/// @param s テキスト
/// @param leftCenter 描画する左辺中心の座標
void PutText(String s, Arg::leftCenter_<Vec2> leftCenter);


/// @brief 指定した位置にテキストを描画します。
/// @param s テキスト
/// @param center 描画する中心座標
void PutText(const char32* s, Arg::center_<Vec2> center);

/// @brief 指定した位置にテキストを描画します。
/// @param s テキスト
/// @param center 描画する中心座標
void PutText(StringView s, Arg::center_<Vec2> center);

/// @brief 指定した位置にテキストを描画します。
/// @param s テキスト
/// @param center 描画する中心座標
Expand Down
120 changes: 120 additions & 0 deletions Siv3D/src/Siv3D/PutText/SivPutText.cpp
Expand Up @@ -15,56 +15,176 @@

namespace s3d
{
void PutText(const char32* s, const double x, const double y)
{
SIV3D_ENGINE(Print)->put(String{ s }, Vec2{ x, y }, 0);
}

void PutText(const StringView s, const double x, const double y)
{
SIV3D_ENGINE(Print)->put(String{ s }, Vec2{ x, y }, 0);
}

void PutText(String s, const double x, const double y)
{
SIV3D_ENGINE(Print)->put(std::move(s), Vec2{ x, y }, 0);
}


void PutText(const char32* s, const Vec2 center)
{
SIV3D_ENGINE(Print)->put(String{ s }, center, 0);
}

void PutText(const StringView s, const Vec2 center)
{
SIV3D_ENGINE(Print)->put(String{ s }, center, 0);
}

void PutText(String s, const Vec2 center)
{
SIV3D_ENGINE(Print)->put(std::move(s), center, 0);
}


void PutText(const char32* s, const Arg::topLeft_<Vec2> topLeft)
{
SIV3D_ENGINE(Print)->put(String{ s }, *topLeft, 1);
}

void PutText(const StringView s, const Arg::topLeft_<Vec2> topLeft)
{
SIV3D_ENGINE(Print)->put(String{ s }, *topLeft, 1);
}

void PutText(String s, const Arg::topLeft_<Vec2> topLeft)
{
SIV3D_ENGINE(Print)->put(std::move(s), *topLeft, 1);
}


void PutText(const char32* s, const Arg::topCenter_<Vec2> topCenter)
{
SIV3D_ENGINE(Print)->put(String{ s }, *topCenter, 2);
}

void PutText(const StringView s, const Arg::topCenter_<Vec2> topCenter)
{
SIV3D_ENGINE(Print)->put(String{ s }, *topCenter, 2);
}

void PutText(String s, const Arg::topCenter_<Vec2> topCenter)
{
SIV3D_ENGINE(Print)->put(std::move(s), *topCenter, 2);
}


void PutText(const char32* s, const Arg::topRight_<Vec2> topRight)
{
SIV3D_ENGINE(Print)->put(String{ s }, *topRight, 3);
}

void PutText(const StringView s, const Arg::topRight_<Vec2> topRight)
{
SIV3D_ENGINE(Print)->put(String{ s }, *topRight, 3);
}

void PutText(String s, const Arg::topRight_<Vec2> topRight)
{
SIV3D_ENGINE(Print)->put(std::move(s), *topRight, 3);
}


void PutText(const char32* s, const Arg::rightCenter_<Vec2> rightCenter)
{
SIV3D_ENGINE(Print)->put(String{ s }, *rightCenter, 4);
}

void PutText(const StringView s, const Arg::rightCenter_<Vec2> rightCenter)
{
SIV3D_ENGINE(Print)->put(String{ s }, *rightCenter, 4);
}

void PutText(String s, const Arg::rightCenter_<Vec2> rightCenter)
{
SIV3D_ENGINE(Print)->put(std::move(s), *rightCenter, 4);
}


void PutText(const char32* s, const Arg::bottomRight_<Vec2> bottomRight)
{
SIV3D_ENGINE(Print)->put(String{ s }, *bottomRight, 5);
}

void PutText(const StringView s, const Arg::bottomRight_<Vec2> bottomRight)
{
SIV3D_ENGINE(Print)->put(String{ s }, *bottomRight, 5);
}

void PutText(String s, const Arg::bottomRight_<Vec2> bottomRight)
{
SIV3D_ENGINE(Print)->put(std::move(s), *bottomRight, 5);
}


void PutText(const char32* s, const Arg::bottomCenter_<Vec2> bottomCenter)
{
SIV3D_ENGINE(Print)->put(String{ s }, *bottomCenter, 6);
}

void PutText(const StringView s, const Arg::bottomCenter_<Vec2> bottomCenter)
{
SIV3D_ENGINE(Print)->put(String{ s }, *bottomCenter, 6);
}

void PutText(String s, const Arg::bottomCenter_<Vec2> bottomCenter)
{
SIV3D_ENGINE(Print)->put(std::move(s), *bottomCenter, 6);
}


void PutText(const char32* s, const Arg::bottomLeft_<Vec2> bottomLeft)
{
SIV3D_ENGINE(Print)->put(String{ s }, *bottomLeft, 7);
}

void PutText(const StringView s, const Arg::bottomLeft_<Vec2> bottomLeft)
{
SIV3D_ENGINE(Print)->put(String{ s }, *bottomLeft, 7);
}

void PutText(String s, const Arg::bottomLeft_<Vec2> bottomLeft)
{
SIV3D_ENGINE(Print)->put(std::move(s), *bottomLeft, 7);
}


void PutText(const char32* s, const Arg::leftCenter_<Vec2> leftCenter)
{
SIV3D_ENGINE(Print)->put(String{ s }, *leftCenter, 8);
}

void PutText(const StringView s, const Arg::leftCenter_<Vec2> leftCenter)
{
SIV3D_ENGINE(Print)->put(String{ s }, *leftCenter, 8);
}

void PutText(String s, const Arg::leftCenter_<Vec2> leftCenter)
{
SIV3D_ENGINE(Print)->put(std::move(s), *leftCenter, 8);
}


void PutText(const char32* s, const Arg::center_<Vec2> center)
{
SIV3D_ENGINE(Print)->put(String{ s }, *center, 0);
}

void PutText(const StringView s, const Arg::center_<Vec2> center)
{
SIV3D_ENGINE(Print)->put(String{ s }, *center, 0);
}

void PutText(String s, const Arg::center_<Vec2> center)
{
SIV3D_ENGINE(Print)->put(std::move(s), *center, 0);
Expand Down

0 comments on commit 86dbf46

Please sign in to comment.