mouseover on mouse down.
This commit is contained in:
@@ -116,8 +116,19 @@
|
|||||||
|
|
||||||
(defn style-label [e font mouse-pos]
|
(defn style-label [e font mouse-pos]
|
||||||
(table! (:label e) :set-style (style :label font (get-color e mouse-pos)))
|
(table! (:label e) :set-style (style :label font (get-color e mouse-pos)))
|
||||||
|
|
||||||
e)
|
e)
|
||||||
|
|
||||||
|
(defn mouse-moved [screen entities options]
|
||||||
|
(let [[x y] (utils/unproject screen options)
|
||||||
|
entities (assoc-in entities [:state :last-pos] [x y])
|
||||||
|
choice-count (dec (count entities))]
|
||||||
|
(when-let [table (get-in entities [:state :table])]
|
||||||
|
(doseq [e (get-in entities [:state :labels])]
|
||||||
|
|
||||||
|
(style-label e (get-in entities [:state :font]) [x y])))
|
||||||
|
entities))
|
||||||
|
|
||||||
(defscreen choice-screen
|
(defscreen choice-screen
|
||||||
:on-show
|
:on-show
|
||||||
(fn [screen entities options]
|
(fn [screen entities options]
|
||||||
@@ -191,15 +202,9 @@
|
|||||||
(assoc-in [:state :table] nil)
|
(assoc-in [:state :table] nil)
|
||||||
(select-keys [:state]))))))
|
(select-keys [:state]))))))
|
||||||
|
|
||||||
:on-mouse-moved (fn [screen entities options]
|
:on-mouse-moved mouse-moved
|
||||||
(let [[x y] (utils/unproject screen options)
|
:on-touch-dragged mouse-moved
|
||||||
entities (assoc-in entities [:state :last-pos] [x y])
|
:on-touch-down mouse-moved
|
||||||
choice-count (dec (count entities))]
|
|
||||||
(when-let [table (get-in entities [:state :table])]
|
|
||||||
(doseq [e (get-in entities [:state :labels])]
|
|
||||||
|
|
||||||
(style-label e (get-in entities [:state :font]) [x y])))
|
|
||||||
entities))
|
|
||||||
|
|
||||||
:on-resize (fn [{:keys [^FitViewport viewport]} entities {:keys [width height]}]
|
:on-resize (fn [{:keys [^FitViewport viewport]} entities {:keys [width height]}]
|
||||||
(.update viewport width height)))
|
(.update viewport width height)))
|
||||||
|
|||||||
Reference in New Issue
Block a user