载入中...
搜索中...
未找到
DamageNumbers.h
浏览该文件的文档.
1#pragma once
2
3#include "common/Export.h"
4#include "common/Result.h"
5
6#include <cstddef>
7#include <memory>
8#include <string>
9#include <vector>
10
11namespace eve::graphics {
12class Graphics;
13class Font;
14
19
22 float lifetime = 1.1f;
23 float velocityY = -90.f;
24 float gravity = 45.f;
25 float scale = 1.f;
26 float pop = 0.5f;
27 float shake = 0.f;
28 float r = 1.f, g = 0.35f, b = 0.25f;
29 float outline = 1.f;
30 float fadeIn = 0.05f, fadeOut = 0.3f;
31 float mergeWindow = 0.18f;
32 float mergeRadius = 64.f;
33 int decimals = 0;
34 bool compact = false;
35};
36
39 double amount = 0.0;
40 float x = 0.f, y = 0.f;
43 std::string group;
45 float velocityX = 0.f;
46};
47
50 std::string text;
51 float x = 0.f, y = 0.f, scale = 1.f, alpha = 0.f;
52 float r = 1.f, g = 1.f, b = 1.f, outline = 0.f;
53};
54
63public:
67 DamageNumbers(const DamageNumbers&) = delete;
69
71 [[nodiscard]] Result<void> setStyle(DamageNumberKind kind, const DamageNumberStyle& style);
73 [[nodiscard]] Result<DamageNumberStyle> style(DamageNumberKind kind) const;
81 [[nodiscard]] Result<void> update(double seconds);
83 void clear();
85 [[nodiscard]] std::size_t count() const;
87 [[nodiscard]] static constexpr std::size_t capacity() { return 256; }
93 [[nodiscard]] std::vector<DamageNumberSample> snapshot() const;
101 void render(Graphics& graphics, Font& font) const;
102
103private:
104 struct Impl;
105 std::unique_ptr<Impl> impl_;
106};
107} // namespace eve::graphics
#define EVENGINE_API_BACKENDS
Definition Export.h:108
const GltfImportRequest & request
Snapshot snapshot
Move-only, checked operation results for the common layer.
Graphics * graphics
std::string kind
int count
Move-only operation result carrying either a value or Status.
Definition Result.h:176
Bounded transient floating-number presentation owned by a game/view. @ownership Owns styles and all l...
static constexpr std::size_t capacity()
Fixed maximum live popup budget; overflow replaces the oldest.
DamageNumbers(const DamageNumbers &)=delete
DamageNumbers & operator=(const DamageNumbers &)=delete
GPU-side font: wraps a decoded font::FontData and rasterizes a fixed set of codepoints into a single ...
Definition Font.h:35
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25
DamageNumberKind
Presentation categories, independent of any combat or settlement module.
DamageNumberAdmission
Observable bounded-pool admission result.
Owning display request. The caller supplies actual committed amounts, never pending damage.
std::string group
Stable caller-defined target/group key; empty disables merging. No entity is retained.
float velocityX
Explicit horizontal launch velocity; injected by the caller, no hidden RNG.
Independent owning frame sample, useful for observation and alternative renderers.
Owning style copied into each popup at spawn. Coordinates are drawable pixels.