View Source DevJoy.Scene.Element.Dialog (DevJoy v1.0.0)

A dialog visually represented in dialog box contains a text to be displayed. Dialog have an optional choices which allows for example to answer a character's question. Dialog allows to display the character information on opposite side. This adds a bit of flexibility for UI design, so dialogs could be styled as messages in chat application.

Example

defmodule MyApp.SceneWithDialog do
  use DevJoy.Scene

  part :dialog do
    dialog :john_doe, "Example dialog"
  end
end

Summary

Types

Dialog box content

Determines on which side of dialog box character should be placed

t()

Dialog struct

Types

@type content() :: String.t()

Dialog box content

@type side() :: :left | :right

Determines on which side of dialog box character should be placed

@type t() :: %DevJoy.Scene.Element.Dialog{
  character: DevJoy.Character.t(),
  choices: [DevJoy.Scene.Element.Choice.t(String.t())],
  content: content(),
  side: side()
}

Dialog struct