14#ifndef DL_DISABLE_RENDER
48 _txt[0]->SetString(fmt::format(
"({})",
to_string(_xy0)));
49 _txt[1]->SetString(fmt::format(
"({})",
to_string(_xy1)));
51 Point xy_dt = _xy1 - _xy0;
52 _txt[2]->SetString(fmt::format(
"dx: {} dy: {}", xy_dt[0], xy_dt[1]));
59 Point xy_center = (_xy0 + _xy1) / 2;
79 for (
auto& iter : _txt)
98 for (
auto& iter : _txt)
102 iter->SetBackground(
true);
108 std::array<gcText, 4> _txt;
void SetParent(Coor *coor)
Position WorldToThis(Position pos) const
将点 从 世界坐标系 转到 自身坐标系
static Coor * Create(Coor *parent=nullptr)
void SetScale(const Position &scale)
gcText CreateText(size_t font_id=0, unsigned font_size=16, const Color &col=ColorDef::WHITE, unsigned font_outline=0, const Color &col_outline=ColorDef::BLACK, unsigned font_shadow=0, const Color &col_shadow=ColorDef::BLACK)
创建一个文本
void Line2D(const Position2 &p0, const Position2 &p1)
void SetCoor(Coor *coor)
设置变换
T DistancePow2(const std::array< T, 2 > &a)
返回 向量 距离的平方
std::string to_string(const SpriteID &id)
constexpr std::array< Point::value_type, N > toPoint(const std::array< T, N > &a)
转换到Point,已知长度
constexpr std::array< Position::value_type, N > toPosition(const std::array< T, N > &a)
转换到Position,已知长度