You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(require 2htdp/image)
(flip-horizontal (text "🦈" 100 "red"))
; ERROR: flip: cannot flip shapes that contain text
is it possible to make flip-horizontal and flip-vertical work with text images in 2htdp/image ? Arguably the color parameter is not needed for emojis. I can think of a few emoji centric games that could be fun to students.
🚣♂️ A fun game I can think of is rowing a boat left and right to avoid a shark from underneath or something, and getting flip-horizontal to change the boat facing direction.
Thanks
The text was updated successfully, but these errors were encountered:
(error 'flip"cannot flip shapes that contain text")]
[(text? atomic-shape)
(error 'flip"cannot flip shapes that contain text")]
but I don't know how to have racket require my local modified version of htdp. Can someone test this? Thanks.
By removing said check above I get:
../../usr/share/racket/pkgs/htdp-lib/2htdp/private/image-more.rkt:964:21: flip-atomic: broke its own contract
promised: np-atomic-shape?
produced: #<void>
in: the range of
(-> np-atomic-shape? np-atomic-shape?)
contract from: (function flip-atomic)
blaming: (function flip-atomic)
(assuming the contract is correct)
at: <pkgs>/htdp-lib/2htdp/private/image-more.rkt:966:18
So it's not just removing 1 line..
Edit: so it seems cairo can do these text flipping transformations since im testing it atm in C.
There are a number of methods for flipped text that need to be implemented, notably image equality. I believe the internal data structure has to change to accommodate flipped text. (It isn't just about drawing things.)
is it possible to make flip-horizontal and flip-vertical work with text images in 2htdp/image ? Arguably the color parameter is not needed for emojis. I can think of a few emoji centric games that could be fun to students.
🚣♂️ A fun game I can think of is rowing a boat left and right to avoid a shark from underneath or something, and getting flip-horizontal to change the boat facing direction.
Thanks
The text was updated successfully, but these errors were encountered: