Skip to content

Commit

Permalink
change color of zoom meter
Browse files Browse the repository at this point in the history
  • Loading branch information
david-vanderson committed Aug 2, 2018
1 parent 0a5ed20 commit da5554a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion LICENSE.txt
@@ -1,4 +1,4 @@
warp
Warp
Copyright (c) David Vanderson

This code is available according to same terms as Racket:
Expand Down
20 changes: 16 additions & 4 deletions client.rkt
Expand Up @@ -549,17 +549,29 @@
(define zcx (- (right) 16 (/ zw 2)))
(define zcy (+ (top) 60 (/ zh 2)))
(prepend! sprites (sprite zcx (+ zcy (- (/ zh 2))) (sprite-idx csd '20x2)
#:layer LAYER_UI #:b (send mapcol blue)))
#:layer LAYER_UI
#:r (send zoomcol red)
#:g (send zoomcol green)
#:b (send zoomcol blue)))
(prepend! sprites (sprite zcx (+ zcy (/ zh 2)) (sprite-idx csd '20x2)
#:layer LAYER_UI #:b (send mapcol blue)))
#:layer LAYER_UI
#:r (send zoomcol red)
#:g (send zoomcol green)
#:b (send zoomcol blue)))
(prepend! sprites (sprite zcx zcy (sprite-idx csd '2x150)
#:layer LAYER_UI #:b (send mapcol blue)))
#:layer LAYER_UI
#:r (send zoomcol red)
#:g (send zoomcol green)
#:b (send zoomcol blue)))

(define zfrac (/ (- (log scale-play) (log (min-scale)))
(- (log (max-scale)) (log (min-scale)))))
(prepend! sprites (sprite zcx (+ zcy (/ zh 2) (- (* zfrac zh)))
(sprite-idx csd '20x2)
#:layer LAYER_UI #:b (send mapcol blue)))
#:layer LAYER_UI
#:r (send zoomcol red)
#:g (send zoomcol green)
#:b (send zoomcol blue)))
(define zbutton (button 'hidden 'zoom #f zcx zcy zw zh "Zoom"
(lambda (x y)
(define zfracy (/ (+ (/ zh 2) (- y)) zh))
Expand Down
3 changes: 2 additions & 1 deletion draw-utils.rkt
Expand Up @@ -13,7 +13,8 @@

(provide (all-defined-out))

(define mapcol (make-color 0 0 200 1.0)) ; sector lines, zoom scale
(define mapcol (make-color 0 0 200 1.0)) ; sector lines
(define zoomcol (make-color 130 50 10 1.0)) ; zoom meter

(define canon-width 800.0)
(define canon-height 600.0)
Expand Down

0 comments on commit da5554a

Please sign in to comment.