added empty-scene
svn: r18138
This commit is contained in:
parent
a7dbbc2fa6
commit
124dbe9b93
|
@ -76,6 +76,7 @@ and they all have good sample contracts. (It is amazing what we can do with kids
|
|||
circle
|
||||
ellipse
|
||||
rectangle
|
||||
empty-scene
|
||||
square
|
||||
rhombus
|
||||
regular-polygon
|
||||
|
|
|
@ -654,6 +654,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)
|
||||
(overlay (rectangle width height 'outline 'black)
|
||||
(rectangle width height 'solid 'white)))
|
||||
|
||||
(define/chk (rhombus side-length angle mode color)
|
||||
(check-mode/color-combination 'rhombus 3 mode color)
|
||||
(let* ([left-corner (make-polar side-length (+ (* pi 1/2) (/ (degrees->radians angle) 2)))]
|
||||
|
@ -956,6 +960,7 @@
|
|||
circle
|
||||
ellipse
|
||||
rectangle
|
||||
empty-scene
|
||||
square
|
||||
rhombus
|
||||
|
||||
|
|
|
@ -630,7 +630,10 @@
|
|||
(make-bb 100 100 100)
|
||||
#f))
|
||||
|
||||
|
||||
(test (empty-scene 185 100)
|
||||
=>
|
||||
(overlay (rectangle 185 100 'outline 'black)
|
||||
(rectangle 185 100 'solid 'white)))
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;
|
||||
;; testing normalization
|
||||
|
|
|
@ -244,6 +244,7 @@
|
|||
(rectangle 48 48 "solid" "gray"))
|
||||
'image
|
||||
"126418b230e.png")
|
||||
(list '(empty-scene 160 90) 'image "216addb7809.png")
|
||||
(list
|
||||
'(above/align
|
||||
"left"
|
||||
|
|
|
@ -621,11 +621,21 @@ Unlike @scheme[scene+curve], if the line passes outside of @scheme[image], the i
|
|||
|
||||
}
|
||||
|
||||
@section{Placing Images}
|
||||
@section{Placing Images & Scenes}
|
||||
|
||||
Placing images into scenes is particularly useful when building worlds
|
||||
and universes using @scheme[2htdp/universe].
|
||||
|
||||
@defproc[(empty-scene [width (and/c real? (not/c negative?))]
|
||||
[height (and/c real? (not/c negative?))])
|
||||
image?]{
|
||||
|
||||
Creates an empty scene, i.e., a rectangle with a black outline.
|
||||
|
||||
@image-examples[(empty-scene 160 90)]
|
||||
|
||||
}
|
||||
|
||||
@defproc[(place-image [image image?] [x real?] [y real?] [scene image?]) image?]{
|
||||
|
||||
Places @scheme[image] onto @scheme[scene] with its center at the coordinates
|
||||
|
|
BIN
collects/teachpack/2htdp/scribblings/img/216addb7809.png
Normal file
BIN
collects/teachpack/2htdp/scribblings/img/216addb7809.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 306 B |
BIN
collects/teachpack/2htdp/scribblings/img/2bed4c99df8.png
Normal file
BIN
collects/teachpack/2htdp/scribblings/img/2bed4c99df8.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
Loading…
Reference in New Issue
Block a user