HammeriteEditorTheme

Editor. Inherits RefCounted

What the editor looks like: one Theme every control in it inherits.

A level editor is read for hours at a time and its job is to leave room for the level, so the rules here are density first - small type, hairline rules, padding measured in single pixels - and one accent used only where the editor is telling the author what is live. It is Hammerite's own look rather than the host game's. A game sets its menus and its HUD; this is the tool, and the two are allowed to disagree. Applied by HammeriteMapEditor to itself, so everything under it inherits and a panel written by an addon gets it for free. A control that needs something else overrides that one thing rather than styling itself from scratch. Sizes here are in the editor's own units: HammeriteEditorCanvas scales the whole editor to its UI scale, so a control that copies one into an override is scaled with everything else and must not scale it again.

Methods

ReturnsMethod
Themetheme() static
Thememake_theme() static
Fontface() static
TextureRectlogo(side: float) static
Labelheading(text: String) static
StyleBoxFlatbadge_style(fill: Color) static

Constants

CANVAS

const CANVAS = Color(0.043137256, 0.050980393, 0.0627451, 1)

Graphite, four steps, plus the black the viewports sit on. Cool rather than neutral: the 3D views are full of warm stone and lamplight, and the chrome should not compete with them.

SURFACE

const SURFACE = Color(0.078431375, 0.09019608, 0.105882354, 1)

Panels, popup menus, dialogs, tab containers and disabled buttons.

RAISED

const RAISED = Color(0.10980392, 0.1254902, 0.14901961, 1)

A button at rest, and the selected tab.

LINE

const LINE = Color(0.16862746, 0.19215687, 0.22745098, 1)

Hairline rules: separators, and the borders of fields, trees and lists.

LINE_BRIGHT

const LINE_BRIGHT = Color(0.22745098, 0.25882354, 0.3019608, 1)

Borders that have to stand off what is behind them - popups, tooltips, windows - and scrollbar grabbers.

TEXT

const TEXT = Color(0.83137256, 0.8509804, 0.8784314, 1)

Type: white is expensive at this size, so it is spent on the thing being read and nothing else.

TEXT_DIM

const TEXT_DIM = Color(0.5529412, 0.5882353, 0.6313726, 1)

Secondary text: headings, the menubar at rest, labels beside values.

TEXT_FAINT

const TEXT_FAINT = Color(0.37254903, 0.40784314, 0.45490196, 1)

Text that is there to be ignored: placeholders, disabled items, menu accelerators.

ACCENT

const ACCENT = Color(0.3019608, 0.60784316, 0.9019608, 1)

One accent, for what is live: the tool in hand, the focused field, the selected row. The viewport keeps its own colours for geometry - a selected brush is yellow in the world, and the chrome must not be saying yellow at the same time about something else.

ACCENT_SUNK

const ACCENT_SUNK = Color(0.105882354, 0.22745098, 0.36078432, 1)

The background of something live: a pressed button, a selected row or menu item, a slider's filled part.

WARNING

const WARNING = Color(0.8784314, 0.6392157, 0.24313726, 1)

Something the author should look at that is not yet an error, such as a map that cannot bake.

DANGER

const DANGER = Color(0.8784314, 0.36078432, 0.36078432, 1)

What has gone wrong. Used by the status bar to say an error has just been written, where an author who is looking at the viewport rather than at the log will still catch it.

VARIANT

const VARIANT = Color(0.5568628, 0.35686275, 0.84705883, 1)

Which variant of the map is being edited: the one thing that says which WORLD is on screen, so none of the colours above may say it - blue is the tool in hand, amber a warning, red an error.

SIZE_TEXT

const SIZE_TEXT = 12

Type size in pixels for labels, buttons, fields and menus: the theme's default.

SIZE_DENSE

const SIZE_DENSE = 11

Type size in pixels for trees, lists, tabs, tooltips and text editors.

SIZE_HEADING

const SIZE_HEADING = 10

Type size in pixels for heading(), which sets its text in capitals.

PAD_X

const PAD_X = 6

Padding, in whole pixels, because half of one is a blurred edge at this size.

PAD_Y

const PAD_Y = 3

Vertical padding inside a button or field; PAD_X is the horizontal.

GAP

const GAP = 4

Spacing between siblings in a box or grid container, and a panel's inner margin, in pixels.

GAP_SECTION

const GAP_SECTION = 6

Spacing between sections of a panel, in pixels: wider than GAP.

ROW_HEIGHT

const ROW_HEIGHT = 20

Height in pixels of one row of chrome, such as a dock's title strip.

Method descriptions

theme()

static func theme() -> Theme

The editor's theme, built on first call and shared afterwards: every caller gets the same Theme, so changing it changes the whole editor. To start one of your own from it, take make_theme().

make_theme()

static func make_theme() -> Theme

A copy of theme() for a caller to change without changing the editor's.

face()

static func face() -> Font

Inter, which core already carries for the 2D gizmo labels: the editor's typeface.

static func logo(side: float) -> TextureRect

The Hammerite seal, side pixels square. A new TextureRect each call, for the caller to add and free.

heading()

static func heading(text: String) -> Label

A section heading: small, dim and spaced out, so it reads as a label on a drawer rather than as a line of text somebody has to take in. text is shown in capitals; a new Label each call.

badge_style()

static func badge_style(fill: Color) -> StyleBoxFlat

The StyleBoxFlat of a filled tag for a word the author must not miss, in fill.

Hammerite 1.0 · built from a6dd634, 2026-10-10