diff options
author | David Thompson <dthompson2@worcester.edu> | 2014-07-02 21:35:06 -0400 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2014-07-02 21:35:06 -0400 |
commit | f2e2c006ec60eede1c7fdea4f4eb86642cb72d3a (patch) | |
tree | 953502af0c4a7244cafc28b66d73175bbd919d9c | |
parent | f186a28057d69e8ebb4b90ba76024be074d3677b (diff) |
Allow some label properties to be signals.
* sly/font.scm (%label-text, %label-position, %label-color): New
procedures.
(label-text, label-position, label-color): Use signal-ref-maybe.
-rw-r--r-- | sly/font.scm | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sly/font.scm b/sly/font.scm index e61adbc..db9c9fd 100644 --- a/sly/font.scm +++ b/sly/font.scm @@ -115,13 +115,17 @@ argument with a default value of 12." (%make-label font text position anchor color texture vertices) label? (font label-font) - (text label-text) - (position label-position) + (text %label-text) + (position %label-position) (anchor label-anchor) - (color label-color) + (color %label-color) (texture label-texture) (vertices label-vertices)) +(define label-text (compose signal-ref-maybe %label-text)) +(define label-position (compose signal-ref-maybe %label-position)) +(define label-color (compose signal-ref-maybe %label-color)) + (define (make-label-vertices texture) "Return a packed array of vertices for TEXTURE." (let ((vertices (make-packed-array texture-vertex 4))) |