sk requested empty scenes with optional background color
This commit is contained in:
parent
da6e819b6f
commit
40948ee653
|
@ -882,10 +882,10 @@
|
|||
(check-mode/color-combination 'square 3 mode color)
|
||||
(make-a-polygon (rectangle-points side-length side-length) mode color))
|
||||
|
||||
(define/chk (empty-scene width height)
|
||||
(define/chk (empty-scene width height [color 'white])
|
||||
(crop 0 0 width height
|
||||
(overlay (rectangle width height 'outline (pen "black" 2 'solid 'round 'round))
|
||||
(rectangle width height 'solid 'white))))
|
||||
(rectangle width height 'solid color))))
|
||||
|
||||
(define/chk (rhombus side-length angle mode color)
|
||||
(check-mode/color-combination 'rhombus 3 mode color)
|
||||
|
|
|
@ -936,14 +936,20 @@ the @racket[point-count] argument determines how many points the star has.
|
|||
Placing images into scenes is particularly useful when building worlds
|
||||
and universes using @racket[2htdp/universe].
|
||||
|
||||
@defproc[(empty-scene [width (and/c real? (not/c negative?))]
|
||||
@defproc*[([(empty-scene [width (and/c real? (not/c negative?))]
|
||||
[height (and/c real? (not/c negative?))])
|
||||
image?]{
|
||||
image?]
|
||||
[(empty-scene [width (and/c real? (not/c negative?))]
|
||||
[height (and/c real? (not/c negative?))]
|
||||
[color image-color?])
|
||||
image?])]{
|
||||
|
||||
Creates an empty scene, i.e., a rectangle with a black outline.
|
||||
Creates an empty scene, i.e., a white rectangle with a black outline.
|
||||
|
||||
@image-examples[(empty-scene 160 90)]
|
||||
|
||||
The three-argument version creates a rectangle of the specified color with
|
||||
a black outline.
|
||||
}
|
||||
|
||||
@defproc[(place-image [image image?] [x real?] [y real?] [scene image?]) image?]{
|
||||
|
|
Loading…
Reference in New Issue
Block a user