Documentation ¶
Overview ¶
Package modal provides UI pop-up modals for Doodle.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConfigEndLevel ¶
type ConfigEndLevel struct { Engine render.Engine Success bool // false = failure condition // Handler functions - what you don't define will not // show as buttons in the modal. Buttons display priority // is as follows these docs in the source code. OnNextLevel func() // Next Level (victory window) OnRetryCheckpoint func() // Retry from Checkpoint (failed) OnPityNextLevel func() // Pity "Next Level" (Azulian Tag) OnRestartLevel func() // Restart Level OnEditLevel func() // Edit Level (if came from editor) OnExitToMenu func() // Exit to Menu // Set these values to show the "New Record!" part of the modal. NewRecord bool IsPerfect bool TimeElapsed time.Duration }
ConfigEndLevel sets options for the EndLevel modal.
type Modal ¶
type Modal struct {
// contains filtered or unexported fields
}
Modal is an instance of a modal, i.e. Alert or Confirm.
func Alert ¶
Alert pops up an alert box modal.
Example ¶
package main import ( "fmt" modal "git.kirsle.net/SketchyMaze/doodle/pkg/modal" ) func main() { alert := modal.Alert("Permission Denied").WithTitle("Error").Then(func() { fmt.Println("Alert button answered!") }) _ = alert }
Output:
func EndLevel ¶
func EndLevel(cfg ConfigEndLevel, title, message string, args ...interface{}) *Modal
EndLevel shows the End Level modal.
Directories ¶
Path | Synopsis |
---|---|
Package loadscreen implements a modal "Loading" screen for the game, which can be shown or hidden by gameplay scenes as needed.
|
Package loadscreen implements a modal "Loading" screen for the game, which can be shown or hidden by gameplay scenes as needed. |
Click to show internal directories.
Click to hide internal directories.