editapp

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package editapp hosts the Linefire map and asset editors in a single window. Ebitengine is single-window per process, so "open the asset editor in another window" is a mode switch: double-clicking an asset in the map editor (or creating one) swaps the active editor to the asset editor, and its Back button (or Esc) returns to the map. The map editor is kept alive across the switch.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(lvl *level.Level, savePath, assetDir string) error

Run opens the single window and starts the game loop.

Types

type App

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

App is the ebiten.Game that delegates each frame to whichever editor is active. A mode switch requested mid-Update (a double-click, New asset, or Back) is staged in pending and applied at the next frame boundary, so the active editor always finishes its frame as the active editor (no detached half-frame).

func New

func New(lvl *level.Level, savePath, assetDir string) *App

New builds the host around a map editor and wires the mode switches.

func (*App) Draw

func (a *App) Draw(screen *ebiten.Image)

Draw renders the active editor.

func (*App) Layout

func (a *App) Layout(outsideWidth, outsideHeight int) (int, int)

Layout returns the active editor's logical resolution.

func (*App) Update

func (a *App) Update() error

Update applies any staged mode switch at the frame boundary, then advances the active editor. Staging the swap (rather than switching mid-Update) keeps each frame's Update and Draw on the same editor.

Jump to

Keyboard shortcuts

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