                       )
           resize-fn (fn [width height]
                       (.resize renderer width height)
-                      (doall (map (partial center-container! canvas)
-                                  (map second layer))))
+                      (doall (map (fn [[name layer-obj]]
+                                    (center-container! canvas layer-obj
+                                                       (or (origins name) :center)))
+                                  layer)))
           expand-fn (fn [] (resize-fn (.-innerWidth js/window)
                                       (.-innerHeight js/window)))
 

             [k v]))}))


(defn- center-container! [canvas layer]
  (let [canvas-width (.-width canvas)
        canvas-height (.-height canvas)
        middle-x (Math/round (/ canvas-width 2))
        middle-y (Math/round (/ canvas-height 2))]

    (log (str "w:" canvas-width " h:" canvas-height))

    ;; start with world centered
    (set! (.-position.x layer) middle-x)
    (set! (.-position.y layer) middle-y)))


(defn init


(defn make-stage
  "Layout the stage structure"
  [{:keys [layers origins
           ]
      :or {
           layers [:backdrop :below :world :above :ui :effect]
           origins {}}}]

  ;(.log js/console (str layers))
  (let [
