View Source DevJoy.Scene.Dialog (DevJoy v1.1.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
@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.Dialog{ character: DevJoy.Character.t(), choices: [DevJoy.Scene.Choice.t(String.t())], content: content(), side: side() }
Dialog struct