(default-exit-event? event)
Default predicate function to decide if an event is an exit-event.
ESC key is the default way to exit.
Default predicate function to decide if an event is an exit-event. ESC key is the default way to exit.
(diagram->svg diagram
&
{:keys [mindra-path width height]
:or {mindra-path "mindra" width 512 height 512}})
Converts a diagram into SVG string using mindra.
Options: :mindra-path -- path to mindra command (defaults to 'mindra') :width -- width of svg to create :height -- height of svg to create
Returns SVG as a string.
Converts a diagram into SVG string using mindra. Options: :mindra-path -- path to mindra command (defaults to 'mindra') :width -- width of svg to create :height -- height of svg to create Returns SVG as a string.
(gloss-draw picture & {:as provided-opts})
Draws a gloss picture.
See https://hackage.haskell.org/package/gloss-1.13.2.1/docs/Graphics-Gloss-Interface-IO-Display.html
Options: :mindra-path -- path to mindra command (defaults to 'mindra') :window -- a map with :width, :height, :x, :y and :title keys for configuring the GUI window (defaults to 512, 512, 10, 10, 'Mindra') :background-color -- a map with :red, :green, :blue, :alpha keys for setting the background color (defaults to 255, 255, 255, 255)
Draws a gloss picture. See https://hackage.haskell.org/package/gloss-1.13.2.1/docs/Graphics-Gloss-Interface-IO-Display.html Options: :mindra-path -- path to mindra command (defaults to 'mindra') :window -- a map with :width, :height, :x, :y and :title keys for configuring the GUI window (defaults to 512, 512, 10, 10, 'Mindra') :background-color -- a map with :red, :green, :blue, :alpha keys for setting the background color (defaults to 255, 255, 255, 255)
(gloss-play world & {:as provided-opts})
Plays a gloss animation starting with given initial state (the world).
See https://hackage.haskell.org/package/gloss-1.13.2.1/docs/Graphics-Gloss-Interface-IO-Game.html
Options:
:mindra-path -- path to mindra command (defaults to 'mindra')
:on-step -- function that takes in world and number of seconds elasped; called on every step
:on-event -- function that takes in world and a map describing the event; called whenever an event fires
:on-exit -- function that takes in world; called when the gloss window is closed
:exit-event? -- a predicate function that takes in an event and decides if it is an exit event
(by default hitting ESC
key is an exit event)
:world->picture -- a function that converts world to a gloss picture
(defaults to creating a rectangle of size 100 x 100)
:window -- a map with :width, :height, :x, :y and :title keys for configuring the GUI window
(defaults to 512, 512, 10, 10, 'Mindra')
:steps-per-second -- number of steps per second (defaults to 50)
Plays a gloss animation starting with given initial state (the world). See https://hackage.haskell.org/package/gloss-1.13.2.1/docs/Graphics-Gloss-Interface-IO-Game.html Options: :mindra-path -- path to mindra command (defaults to 'mindra') :on-step -- function that takes in world and number of seconds elasped; called on every step :on-event -- function that takes in world and a map describing the event; called whenever an event fires :on-exit -- function that takes in world; called when the gloss window is closed :exit-event? -- a predicate function that takes in an event and decides if it is an exit event (by default hitting `ESC` key is an exit event) :world->picture -- a function that converts world to a gloss picture (defaults to creating a rectangle of size 100 x 100) :window -- a map with :width, :height, :x, :y and :title keys for configuring the GUI window (defaults to 512, 512, 10, 10, 'Mindra') :steps-per-second -- number of steps per second (defaults to 50)
(handle-event writer configuration world event)
Handles an event message sent by mindra.
Handles an event message sent by mindra.
(handle-gloss-init-request writer configuration)
Handles initialization request from mindra for setting it up for Gloss.
Handles initialization request from mindra for setting it up for Gloss.
(handle-gloss-ready writer configuration world message-body)
Handles ready message from mindra for Gloss.
Handles ready message from mindra for Gloss.
(handle-picture-request writer configuration world)
Handles a picture request message sent by mindra.
Handles a picture request message sent by mindra.
(handle-shutdown writer configuration world)
Handles shutdown message from mindra.
Handles shutdown message from mindra.
(handle-step writer configuration world message-body)
Handles a step message sent by mindra.
Handles a step message sent by mindra.
(handle-svg-init-request writer configuration)
Handles initialization request from mindra for setting it up for SVG drawing.
Handles initialization request from mindra for setting it up for SVG drawing.
(handle-svg-ready writer configuration svg message-body)
Handles ready message from mindra for SVG drawings.
Handles ready message from mindra for SVG drawings.
(handle-svg-request writer _configuration svg)
Handles a SVG request message sent by mindra.
Handles a SVG request message sent by mindra.
(parse-event message-body)
Parses an event message from mindra to a dict with :name and :args.
Parses an event message from mindra to a dict with :name and :args.
(print-and-raise-mindra-failure tag body)
Prints and raises a failure message from mindra.
Prints and raises a failure message from mindra.
(read-message reader)
Reads a message sent by mindra.
Reads a message sent by mindra.
(start-mindra-or-fail path)
Starts mindra command from given command or fails with a helpful error message.
Starts mindra command from given command or fails with a helpful error message.
(write-message writer tag)
(write-message writer tag body)
Writes a message to mindra's stdin.
Writes a message to mindra's stdin.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close