From 12a58eb55b1afd7dad5b9865b9e86fc85ac1d675 Mon Sep 17 00:00:00 2001 From: Omar Rizwan Date: Thu, 12 Oct 2023 12:49:00 -0400 Subject: display: Error on Display:: calls; implement titles with wish --- virtual-programs/display.folk | 2 +- virtual-programs/display/text.folk | 8 ++++++-- virtual-programs/title.folk | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) (limited to 'virtual-programs') diff --git a/virtual-programs/display.folk b/virtual-programs/display.folk index 387d300a..ed3fb62d 100644 --- a/virtual-programs/display.folk +++ b/virtual-programs/display.folk @@ -20,7 +20,7 @@ namespace eval ::Display { foreach func {stroke circle text fillTriangle fillQuad fillPolygon} { proc $func args { set func [lindex [info level 0] 0] - uplevel [list Wish display runs [list $func {*}$args] on layer $::Display::LAYER] + error "$func has been removed; use GPU shaders" } } } diff --git a/virtual-programs/display/text.folk b/virtual-programs/display/text.folk index a6c828b9..14f0294a 100644 --- a/virtual-programs/display/text.folk +++ b/virtual-programs/display/text.folk @@ -103,8 +103,12 @@ On process "display" { [list /someone/ wishes to draw text with /...options/] When /someone/ wishes to draw text with /...options/ { - set x0 [dict get $options x] - set y0 [dict get $options y] + if {[dict exists $options center]} { + lassign [dict get $options center] x0 y0 + } else { + set x0 [dict get $options x] + set y0 [dict get $options y] + } set scale [dict_getdef $options scale 1.0] set text [dict get $options text] set radians [dict get $options radians] diff --git a/virtual-programs/title.folk b/virtual-programs/title.folk index fccacc17..3187ed3c 100644 --- a/virtual-programs/title.folk +++ b/virtual-programs/title.folk @@ -14,7 +14,7 @@ When /thing/ has region /region/ { if {$text eq ""} { return } set scale 1 - Display::text {*}$top $scale $text $radians + Wish to draw text with center $top scale $scale text $text radians $radians } When the collected matches for [list /someone/ wishes $thing is footnoted /text/] are /matches/ { @@ -22,6 +22,6 @@ When /thing/ has region /region/ { if {$text eq ""} { return } set scale 1 - Display::text {*}$bot $scale $text $radians + Wish to draw text with center $bot scale $scale text $text radians $radians } } -- cgit v1.2.3