mapeditor

package
v0.0.49 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 28 Imported by: 0

Documentation

Overview

Package mapeditor implements the Linefire stage (phase) editor: a top-down 2D world editor for walls, the player start, enemy/power-up spawns and trigger zones. It shares editorkit (camera, grid, history) and render (vector + glow) with the asset editor.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MapEditor

type MapEditor struct {
	// contains filtered or unexported fields
}

MapEditor is the ebiten.Game for stage editing.

func New

func New(l *level.Level, savePath, assetDir string) *MapEditor

New creates a map editor for the given level. savePath is the file used when saving; assetDir is scanned for placeable spawn assets.

func (*MapEditor) Draw

func (e *MapEditor) Draw(screen *ebiten.Image)

Draw renders the editor for one frame.

func (*MapEditor) Layout

func (e *MapEditor) Layout(outsideWidth, outsideHeight int) (int, int)

Layout uses a fixed logical resolution.

func (*MapEditor) Persist

func (e *MapEditor) Persist()

Persist writes any unsaved changes now, e.g. before the host switches to a different map or asset.

func (*MapEditor) ReloadPalette

func (e *MapEditor) ReloadPalette()

ReloadPalette rescans the asset/map directory, e.g. after returning from the asset editor or creating a new asset.

func (*MapEditor) ResetTitle

func (e *MapEditor) ResetTitle()

ResetTitle forces the next updateTitle to push to the window, used when the host re-activates this editor after another mode changed the window title.

func (*MapEditor) SetOnOpenAsset

func (e *MapEditor) SetOnOpenAsset(fn func(path string))

SetOnOpenAsset wires the host callback that opens an asset file for editing in the same window. Called by the editapp host; nil means standalone (no-op).

func (*MapEditor) SetOnOpenMap

func (e *MapEditor) SetOnOpenMap(fn func(path string))

SetOnOpenMap wires the host callback that opens a different map for editing.

func (*MapEditor) Update

func (e *MapEditor) Update() error

Update advances one frame.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL