Skip to content

Set Marker

One instruction for every property of every marker: whatever this kind understands is what changes

tick 0
Jump -> 90
if
Make Marker1
typeid #xyreplace?
Set Marker2
typeid #color
Set Marker3
typeid #radius
Make Marker4
typeid #xyreplace?
Print5
Set Marker6
typeid #fetch?
Make Marker7
typeid #xyreplace?
Set8
=
Set Marker9
typeid #rotation
@counter0number
wasPlacednullnull
setmarker color 1 %ff5555 0 0
setmarker radius 1 20 0 0
setmarker rotation 1 @time 0 0

Marker number one turns red, grows and slowly rotates: the last line runs every iteration, and the rotation follows the time.

Field What is in it
first what to change: a property from the list
second the marker’s id
the other three values — as many as that property needs

There are many properties, and each kind has its own

Section titled “There are many properties, and each kind has its own”

The list is shared across all kinds of marker — two dozen properties and more:

Property What it does
pos, endPos move the marker; for a line, its other end
color, radius, stroke colour, size, line thickness
shape the number of sides of a polygon
rotation, arc rotation and arc
text, flushText, fontSize the text and its size
textAlign, lineAlign, labelFlags alignment, backing and outline of a caption
texture, textureSize a picture and its size
world, minimap, autoscale where the marker is visible and whether it grows on zoom
drawLayer the order: what goes over what
remove delete the marker entirely

Colour is written two ways: as the literal %ff5555 straight into the field, or as a packed number from packcolor. The second is for when the colour is computed — green shading into red as the stock runs down, for instance.

Text is not given as a value — it is handed over from the print buffer:

print "Build here"
setmarker flushText 2 0 0 0

The same trick as printflush and message: the text is assembled, handed over, and the buffer is cleared. Hence the convenience — numbers and variables can be printed into a marker, not just a string.

Property What it means
world draw on the map (yes by default)
minimap draw on the minimap
autoscale shrink when zoomed out, so as not to cover the map

A marker can be taken off the map entirely and left on the minimap only — that is how danger zones are marked when they should not get in the way of looking at the base.

Unofficial fan project, not affiliated with Anuke. Mindustry sprites, fonts and translations © Anuke, used under GPL-3.0; Fira Code under OFL-1.1. Site code is GPL-3.0.