ElixirDoom.Render (elixir_doom v0.2.0)

Copy Markdown View Source

A player's view drawn as a picture of any size: the level through Cauldron2D.Sectors.View, the weapon in hand, messages, the status bar along the bottom, the automap when it is open, the screen's red and gold flashes, and the tallies between levels.

ElixirDoom.Render.picture(view, {320, 200}, 1.0, automap: false)

The picture keeps Doom's layout at any size: the bottom 32 of every 200 rows are the status bar, and everything in it, the weapon and the messages are Doom's 320 by 200 screen stretched to fit. aspect is a pixel's width against its height on screen.

Options

  • :automap, :seen_key — the automap open, and the key its seen lines are kept under
  • :options — the player's options (ElixirDoom.Menu.defaults/0): :screen_blocks 3 to 11 as Doom's screen size (below 10 a smaller view framed by the border flat and its edges, 11 no status bar), :detail :high or :low (the view drawn half as wide and doubled), :messages whether pickup messages show
  • :menu — an open ElixirDoom.Menu, drawn over the picture

Summary

Functions

rgba (width by height) with an open menu drawn over it, or as it is when menu is nil.

Draw view as a raster width by height, with the options above.

The lines of the level view sees, recorded under key for the automap, as a view width by height drawn with aspect would see them.

Functions

picture(view, arg, aspect, opts \\ [])

@spec picture(map(), {pos_integer(), pos_integer()}, number(), keyword()) ::
  FrenchCurve.Raster.t()

Draw view as a raster width by height, with the options above.

record_seen(view, key, arg3, aspect)

@spec record_seen(map(), term(), {pos_integer(), pos_integer()}, number()) :: :ok

The lines of the level view sees, recorded under key for the automap, as a view width by height drawn with aspect would see them.