mirror of
https://github.com/orange-cpp/omath.git
synced 2026-04-19 02:23:27 +00:00
added realization
This commit is contained in:
@@ -10,13 +10,7 @@
|
||||
#include <string_view>
|
||||
namespace omath::hud
|
||||
{
|
||||
enum class SnapLineStartPosition
|
||||
{
|
||||
SCREEN_BOTTOM,
|
||||
SCREEN_TOP,
|
||||
SCREEN_CENTER,
|
||||
};
|
||||
class EntityOverlay
|
||||
class EntityOverlay final
|
||||
{
|
||||
public:
|
||||
EntityOverlay(const Vector2<float>& top, const Vector2<float>& bottom,
|
||||
@@ -59,14 +53,14 @@ namespace omath::hud
|
||||
void add_top_bar(const Color& color, const Color& outline_color, const Color& bg_color, float height,
|
||||
float ratio, float offset = 5.f);
|
||||
|
||||
void add_snap_line(const SnapLineStartPosition& start_pos, const Color& color, float width);
|
||||
void add_snap_line(const Vector3<float>& start_pos, const Color& color, float width);
|
||||
|
||||
private:
|
||||
static void draw_outlined_text(const Vector2<float>& position, const Color& color,
|
||||
void draw_outlined_text(const Vector2<float>& position, const Color& color,
|
||||
const std::string_view& text);
|
||||
CanvasBox m_canvas;
|
||||
Vector2<float> m_text_cursor_right;
|
||||
Vector2<float> m_text_cursor_top;
|
||||
std::shared_ptr<HudRendererInterface> renderer;
|
||||
std::shared_ptr<HudRendererInterface> m_renderer;
|
||||
};
|
||||
} // namespace omath::hud
|
||||
@@ -14,9 +14,9 @@ namespace omath::hud
|
||||
virtual void add_line(const Vector2<float>& line_start, const Vector2<float>& line_end, const Color& color,
|
||||
float thickness) = 0;
|
||||
|
||||
virtual void add_polyline(const std::span<const Vector2<float>>& vertexes, float thickness) = 0;
|
||||
virtual void add_polyline(const std::span<const Vector2<float>>& vertexes, const Color& color, float thickness) = 0;
|
||||
|
||||
virtual void add_filled_polyline(const std::span<const Vector2<float>>& vertexes, float thickness) = 0;
|
||||
virtual void add_filled_polyline(const std::span<const Vector2<float>>& vertexes, const Color& color, float thickness) = 0;
|
||||
|
||||
virtual void add_rectangle(const Vector2<float>& min, const Vector2<float>& max, const Color& color) = 0;
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ namespace omath::hud
|
||||
~ImguiHudRenderer() override;
|
||||
void add_line(const Vector2<float>& line_start, const Vector2<float>& line_end, const Color& color,
|
||||
float thickness) override;
|
||||
void add_polyline(const std::span<const Vector2<float>>& vertexes, float thickness) override;
|
||||
void add_filled_polyline(const std::span<const Vector2<float>>& vertexes, float thickness) override;
|
||||
void add_polyline(const std::span<const Vector2<float>>& vertexes, const Color& color, float thickness) override;
|
||||
void add_filled_polyline(const std::span<const Vector2<float>>& vertexes, const Color& color, float thickness) override;
|
||||
void add_rectangle(const Vector2<float>& min, const Vector2<float>& max, const Color& color) override;
|
||||
void add_filled_rectangle(const Vector2<float>& min, const Vector2<float>& max, const Color& color) override;
|
||||
void add_text(const Vector2<float>& position, const Color& color, const std::string_view& text) override;
|
||||
|
||||
Reference in New Issue
Block a user