载入中...
搜索中...
未找到
DamageNumbersBindings.cpp
浏览该文件的文档.
36 table.addClass<Font>("GraphicsFont", std::function<Font*()>([]() -> Font* { return nullptr; }), true);
62 table.addClass<DamageNumbers>("DamageNumbers", std::function<DamageNumbers*()>([] { return nullptr; }), false);
70 cls.addFunc("spawn", [vm](DamageNumbers* self, float amount, float x, float y, const std::string& kind,
74 return script::projectResult(vm, self->spawn({amount, x, y, parsed.value(), group, velocityX}), admission);
76 cls.addFunc("setStyle", [vm](DamageNumbers* self, const std::string& kind, const DamageNumberStyle* value) {
81 vm, Status::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, "Style is required", "style")));
85 [vm](DamageNumbers* self, float seconds) { return script::projectResult(vm, self->update(seconds)); });
102 vm, Status::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, "Graphics and font are required",
The single Squirrel projection for common Result, Status and Value.
Explicit Value/Owned/Borrowed semantics at the Squirrel boundary.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.cpp:21
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
static Status success(StatusCode code=StatusCode::Ok)
Construct a successful status with an explicit non-error outcome.
Definition Status.cpp:19
static Status failure(StatusCode code, Diagnostic diagnostic)
Construct a failed status with one diagnostic.
Definition Status.cpp:28
Bounded transient floating-number presentation owned by a game/view. @ownership Owns styles and all l...
Definition DamageNumbers.h:62
Result< DamageNumberAdmission > spawn(const DamageNumberRequest &request)
Validate and admit one popup. Failure leaves pool and sequence unchanged.
Definition DamageNumbers.cpp:79
Result< void > update(double seconds)
Advance injected seconds; nonfinite/negative dt fails without mutation.
Definition DamageNumbers.cpp:113
Result< void > setStyle(DamageNumberKind kind, const DamageNumberStyle &style)
Validate and replace one future-spawn style; existing entries keep their own copy.
Definition DamageNumbers.cpp:62
std::vector< DamageNumberSample > snapshot() const
Build an independent owning frame snapshot for observation. @cost Linear allocations/copies in live e...
Definition DamageNumbers.cpp:141
void clear()
Remove every transient entry; deterministic spawn sequence restarts.
Definition DamageNumbers.cpp:119
GPU-side font: wraps a decoded font::FontData and rasterizes a fixed set of codepoints into a single ...
Definition Font.h:35
bool hasGlyph(int codepoint) const
Whether codepoint was rasterized into this Font's atlas.
Definition Font.cpp:178
float getBaseline() const
Distance from the top of a line to the baseline (== getAscent()).
Definition Font.cpp:174
float getHeight() const
Line height in pixels at the FontData's decoded pixel size.
Definition Font.cpp:172
float getWidth(const std::string &text) const
Pixel width of text (UTF-8), including kerning; delegates to FontData.
Definition Font.cpp:176
Definition Graphics.h:134
std::variant< std::monostate, std::int64_t, double, std::string, bool > Value
Definition Database.h:27
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25
void exposeFontAndDamageNumberBindings(ssq::Table &table, ssq::Class &graphicsClass)
Register font and popup script types on the VM owner thread; retain no table references.
Definition DamageNumbersBindings.cpp:33
@ ReplacedOldest
ssq::Table projectStatusResult(HSQUIRRELVM vm, const Status &status)
Project a checked native status that carries no payload.
Definition SquirrelBinding.cpp:524
ssq::Table projectResult(HSQUIRRELVM vm, Result< void > &&result)
Consume and project a void native Result using the common schema.
Definition SquirrelBinding.cpp:540
eve::Result< ssq::Object > makeOwnedSquirrelInstance(HSQUIRRELVM vm, Owned< T > object)
Creates a Squirrel instance that owns a C++ wrapper through a release hook.
Definition SquirrelOwnership.h:240
@ InvalidArgument
Owning style copied into each popup at spawn. Coordinates are drawable pixels.
Definition DamageNumbers.h:21