47 _txt[0]->SetString(fmt::format(
"({})",
to_string(_xy0)));
48 _txt[1]->SetString(fmt::format(
"({})",
to_string(_xy1)));
50 Point xy_dt = _xy1 - _xy0;
51 _txt[2]->SetString(fmt::format(
"dx: {} dy: {}", xy_dt[0], xy_dt[1]));
52 _txt[3]->SetString(fmt::format(
"dis: {}", (
unsigned)sqrt(
Math::DisPow2(xy_dt))));
58 Point xy_center = (_xy0 + _xy1) / 2;
78 for (
auto& iter : _txt)
97 for (
auto& iter : _txt)
101 iter->SetBackground(
true);
107 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 Line(const Position3 &p0, const Position3 &p1)
void SetCoor(Coor *coor)
设置变换
T DisPow2(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< T, N+1 > toLonger(const std::array< T, N > &a, const T &v={})
长度+1
constexpr std::array< Position::value_type, N > toPosition(const std::array< T, N > &a)
转换到Position,已知长度