Package com.botwithus.bot.api.draw
Draw, reached through api.draw(),
is the entry point. DrawFrame is how a script
that draws more than a couple of things per tick should draw them.
Four things about the wire that this package deliberately does not hide:
- A batch reports refusals inside a successful reply. See
DrawBatchResult. - A batch is capped at
DrawLimits.MAX_BATCH_ITEMSitems and an over-size one is refused whole. - A listed TTL is what is left, not what you sent. See
DrawEntry.remainingTtlMs(). - A component highlight's key has a conventional auto format, and it is
exposed rather than left implicit. See
DrawCommand.ComponentTarget.autoKey(int, int).
World space (DrawSpace.WORLD) now works:
the producer projects it to the screen on its own thread. The signatures shipped
before it did, deliberately, and none of them had to change when it landed —
which was the whole point of putting the field on the wire early. Two carve-outs
remain: a polyline is refused in world space, and a component highlight is
already on screen so it has no world position.
World coordinates are bounded by
DrawLimits.MAX_WORLD_COORDINATE, which is a
different and larger limit than the screen one — the two gate what you send and
what it projects to, respectively.
-
ClassDescriptionTurns a space, a style and a caption into a concrete
DrawCommand.Packed0xAARRGGBBcolours for debug drawing, and the two helpers for building one.Debug-drawing facade.What a batched submit actually achieved.Fluent presentation chain for one draw command.The words a captioned command draws, and the style to draw them in.A fixed-point number the producer formats.Literal text.The absence of a caption.Fluent chain for the two commands that draw words — atextcommand and a captioned component highlight.One fully-specified draw command, ready for the wire.A highlight over awidthTilesbyheightTilesblock of ground, anchored at its minimum corner.A highlight that tracks an interface component rather than a rectangle.Ellipse inscribed in the given rectangle, stroked or filled.A highlight that tracks a live entity — an NPC, another player, or the local player.A command only ahighlight_*call can carry, because what it marks is a thing rather than a place.Straight segment from(x1, y1)to(x2, y2).Polyline over a flat[x, y, x, y, ...]list of 2 to 32 pairs.A commanddebug_draw_setcarries: the caller names itskindand itsspace, and the producer stores the geometry as sent.Axis-aligned rectangle, stroked or filled perDrawStyle.isFilled().A caption anchored at(x, y).A highlight over exactly one game tile, on a named plane.Turns a space and a style into a concreteDrawCommand.One retained draw command as the producer currently holds it.The text styles the producer can draw a caption in.A tick's worth of drawing, collapsed into as few round-trips as the wire allows.The primitive shapes the producer's overlay can retain.The producer's hard limits on debug drawing, named once so no caller has to spell a bare number.The coordinate space a draw command's geometry is expressed in.The producer's own account of its overlay: how full the store is, what it has refused, and whether the renderer is alive.The presentation half of a draw command — everything that is not geometry.Which list a highlighted entity's index belongs to.Fluent chain for a highlight — the four calls that mark a thing rather than a place.Turns a style and a caption into a concreteDrawCommand.Highlight.