evaluate supplies the value for each entity.
evaluate runs once per entity every tick, so keep it cheap. You don’t draw anything yourself:
return a value and the builder draws it.Overview
Classes
esp.class, context.Elements
text, bar, icon.Return values
Text and bar shapes.
Element handles
alive, enabled, preview, dispose.Classes
class
class is a reserved word, so the named import needs a rename:
import { class as espClass } from "@native/esp";.
context
ctx every evaluate of
the class gets. A throw hides all of the class’s elements on that entity for the tick. Set it to
null to remove it.
Elements
Every element takes the same definition object.
A throw inside
evaluate hides the element on that entity for the tick and is reported through
the global error event.
text
null to hide it.
bar
0..1, a style object, or null to hide it.
icon
text, but always drawn with the "weapon-icons" font: the text is the glyph string.
Return values
Returned keys override the user’s builder settings for that entity and tick. Keys you leave out keep what the user set.Text style
Fortext and icon.
Bar style
Element handles
text, bar and icon return an EspElement. Defining the same type and name again replaces
the element: the new one keeps the builder slot and the user’s layout, the old handle goes dead.
On a dead handle reads return
null and writes throw. Everything is removed when the script
unloads.