     update: ->
 
 
+B.defineAction "ui.html.jade", 
+  doc: "Compiles a template using the Jade template engine"
+  parameterDefs:
+    template: 
+      type: B.String
+      constant: true
+    output: B.String # shorthand syntax
+    locals: B.Object({}) # shorthand syntax
 
+  action: (temp, params) ->
+    init: -> 
+      jade = require("jade")
+      temp.compiledTemplate = jade.compile(params.template.value)
+    destroy: ->
+    update: -> 
+      # in case params don't change, do nothing
+      if not params.locals.value.hasChanged then return 
+
+      params.output.value = temp.compiledTemplate(params.locals.value)
+

    location: 
      type: B.String 
      default: "body"
      constant: true

  action: (params) ->
    init: -> $(params.location).html(params.html.get())

    introScreen "in"

B.declareAssets
  baseTemplate: 
    type: B.String
    url: "template.html"
  loadingScreen: "loading.html" # type auto-detection
  pauseScreen: "pause.html"
  introScreen: "intro.html"
  creditsScreen: "credits.html"


# allows action to be changed later
B.defineAction "ui.html.show", 
  doc: "Shows HTML in the given location"
  parameterDefs:
    html: 
