Not all animation involves moving or hiding objects. You can create an animation just by setting the colors of various objects.
The object representing the TV screen has a script that cycles its rgbFill property through 512 colors of the RGB spectrum.
Each panel of the colorful sculpture on the right cycles through four colors..h four colors.ur colors.
out,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
in,true
ThreeDeeRect
strChecked
strChecked
bottomLine
l | J
strChecked
topLine
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
curColor
fucurColor
gucurColor
notifybefore
Zcolorlist[4]
1]=128,128,0
2]=255,0,255
+3]=0,128,128
;=0,255,0
curColor =
k4 + 1
orgbfill
colorList[
curColor
strChecked
curColor
fucurColor
gucurColor
notifybefore
Zcolorlist[4]
1]=128,128,0
2]=255,0,255
+3]=0,128,128
;=0,255,0
curColor =
k4 + 1
orgbfill
colorList[
curColor
strChecked
curColor
fucurColor
gucurColor
-- cycles through four colors
notifybefore
Zcolorlist[4]
1]=128,128,0
2]=255,0,255
+3]=0,128,128
;=0,255,0
curColor =
k4 + 1
orgbfill
colorList[
curColor
strChecked
curColor
fucurColor
gucurColor
notifybefore
Zcolorlist[4]
1]=128,128,0
2]=255,0,255
+3]=0,128,128
;=0,255,0
curColor =
k4 + 1
orgbfill
colorList[
curColor
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
6 F J
strChecked
strChecked
Z!j!J
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
0&@&J
strChecked
strChecked
T'd'J
strChecked
strChecked
j(z(J
strChecked
strChecked
strChecked
.*>*J
strChecked
strChecked
"+2+J
strChecked
strChecked
strChecked
strChecked
.&, "
.&, "
oplastTime
timegettime
-- cycle through 512 colors
the rgb spectrum.
notifybefore
inc = 32 -- amount
each
orgbfill
r = (r+
g = (g+
b = (b+
lastTime
timegettime()
20B0J
R0^0mp
strChecked
lastTime
strChecked
o 44&
strChecked
.2>2J
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
F6V6J
strChecked
strChecked
strChecked
&868J
strChecked
strChecked
J9Z9J
strChecked
strChecked
false
Animating with color
Untitled
Simulating gravity
Useful scripts
myChapter
myChapterID
chapterCount
topicCount
false
visited
Simulating gravity
label
strChecked
This page has a useful handler for animating falling objects. You provide the handler with the object that you want to "drop," how tall that object is supposed to be, where the ground is, and the starting speed of the object.
Press the Animate button on the right to see a demonstration.nstration.
out,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
in,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
ground
strChecked
strChecked
.animate
buttondown
animate message, handled
strChecked
out,false
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
Animate
thought
strChecked
thought5
strChecked
thought4
strChecked
thought3
strChecked
thought2
strChecked
thought1
strChecked
ground
finaly
accelerate
animate
animate
finaly =
U"ground"
accelerate
,2,finalY
,1.5,
5625,684
origloc
strChecked
strChecked
strChecked
strChecked
Simulating Gravity
Script recorder
Timing animation
Useful scripts
myChapter
myChapterID
visited
Timing animation
label
strChecked
When you want animation to move at a particular speed regardless of the machine it's on, you can write a handler to check the time during the animation process.
The function timeGetTime() in the mmsystem DLL file is useful for this purpose. This function returns the time in milliseconds. The mmsystem DLL comes with Windows 3.1.
out,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
in,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
d t J
strChecked
The animated globe above is a series of 16 frames. The buttons controlling its speed set a user property of the globe called Delay to various values (0 for "Fast," 60 for "medium," and 120 for "Slow"). The script in the globe checks to see if at least that many milliseconds have passed before displaying the next frame....
speedControl
strChecked
globe
delay
buttonclick
buttonclick
delay
"globe"
strChecked
Fa&st
globe
delay
buttonclick
buttonclick
delay
"globe"
strChecked
&Medium
globe
delay
buttonclick
buttonclick
delay
"globe"
strChecked
Slo&w
strChecked
globe
216412,4,0
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
b r J
strChecked
strChecked
strChecked
enterpage
false
Timing Animation
Moving along a line
" v ,
Useful scripts
myChapter
myChapterID
false
visited
chapterCount
topicCount
Moving along a line
label
strChecked
Often, you just want to move an object along a straight line. This page contains a handler for doing that. You pass it the object you want to move, the line that you want to move the object along, and how many steps you want to take along the line.
Note that this handler will move an object along angled lines as well. Once you've positioned the guiding lines, you can hide them.
strChecked
PmoveObjectAlongPath
buttonclick
buttonclick
-- sends message handled
moveObjectAlongPath
m"path",15
strChecked
in,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
strChecked
Click each of the ellipses above to see them move along their respective paths.
PmoveObjectAlongPath
buttonclick
buttonclick
-- sends message handled
moveObjectAlongPath
"yoyo",40
strChecked
Moving Along a Line
content
chapterCount
topicCount
selectChars
false
visited
strChecked
outline
lineheight
hotfield
outfield
sizeSample
adjustsize
sized
enterpage
reader
-- initialize the
sized
hotfield =
"sizeSample"
outfield =
"outline"
ypix =
sysPageUnitsPerPixel
o =
b =
syssuspendmessages =
adjustsize
ylineheight
o,3)
notifybefore
notifyAfter
strChecked
sizeSample
strChecked
sizeSample
strChecked
outline
strChecked
Moving objects 2
Position property 3
Script recorder 4
Move command 5
Move to command 7
Move by command 6
Moving on idle 8
Frame animation 9
How it works 10
Hiding and showing 11
Animating buttons 12
Useful scripts 13
Animating with color 14
Simulating gravity 15
Timing animation 16
Moving along a line 17 17 17e 17Moving in a Arc 91ipts 65
Animating with color 87
Simulating Gravity 67
Timing Animation 66
Moving Along a Line 90
Moving in a Arc 91
marker
vertLoc
vertLoc b
value
ypix =
syspageunitsperpixel
s =
halfH =
C- 3*
strChecked
cancel
spacer
outline
LPscrollToSelectedTextLine
Enter title for this chapter.
Untitled
title
buttonclick
buttonclick
("Enter title
chapter."
f"Untitled"
o =
"outline"
& spacer() & New
selectedtextlines
scrollToSelectedTextLine
strChecked
New Chapter...
cancel
Enter title for this topic.
spacer
outline
LPscrollToSelectedTextLine
Untitled
tline
title
buttonclick
buttonclick
("Enter title
f"Untitled"
t =
=& spacer() & "
o =
"outline"
stl = selectedTextLines
M = textlineCount(
k& t
selectedtextlines
scrollToSelectedTextLine
strChecked
New Topic...
editTopic
cancel
extractName
extractID
Change title of this
spacer
chapterOrTopic
outline
chapter
topic
newTitle
idnum
title
buttonclick
buttonclick
chapterOrTopic = "
o =
"outline"
stl = selectedTextLines
tlineNum =
t =
Btlinenum
title = extractName(t)
idnum = extractID(t)
-- Localization issue
("Change
" &&
&"."
newTitle =
ZnewLine
O& spacer() &
strChecked
Edit Title...
strChecked
strChecked
strChecked
Topics
Chapter headings
updateBook
ainitPage
buttonclick
buttonclick
updateBook
"Chapter headings"
"Topics"
initPage
close
strChecked
strChecked
Rearrange chapters and topics by dragging and dropping them.
buttonclick
buttonclick
close
strChecked
Cancel
enterpage
reader
toolbar
ComboBox
xcombobox
focuswindow =
false
visited
strChecked
previous
buttonclick
buttonclick
-- sends the
message
currentPage
strChecked
buttonclick
buttonclick
-- sends the
tmessage
currentPage
strChecked
heading
raisedField
tbk_wid_name
faceColor
highlightColor
shadowColor
tbk_wid_props
color,hls
color,hls
color,hls
tbk_wid_values
faceText
strChecked
highlight
strChecked
Moving objectsnts
shadow
strChecked
Moving objectsnts
" 2 J
strChecked
Moving objectsnts
buttonclick
buttonclick
currentPage
focuswindow =
strChecked
tableOfContents
tableOfContents
buttonclick
buttonclick
-- handled
Hthe
message navigates
-- table
contents
tableOfContents
currentPage
strChecked
Table of contents
SectionLabel
strChecked
Section:
outline
@4bookOverview
buttonup
bookOverview
strChecked
topics
topics
buttonclick
buttonclick
-- causes navigation
chapter heading
currentPage
focuswindow =
strChecked
Topics
train
b;origloc
train
animate
b;origloc
train
initAnimation
animate
t =
"train"
rightMost =
p =
moveAmount = 45
origloc
initAnimation
t =
false
visited
strChecked
train
-1485,90
origloc
strChecked
pageUnits
false
visited
Page Units:
Each pixel on the screen is several page units wide by several units tall. The amount varies depending on your screen resolution. The sysPageUnitsPerPixel system property will tell you how many page units there are for each horizontal and vertical pixel represented on the screen. For example, in standard VGA, there are 15 page units per horizontal pixel and 15 per vertical pixel.
strChecked
strChecked
scriptRecorderPopup1
false
visited
scriptRecorderPopup1
To use the script recorder:
1. Make sure the objects you want to move are not selected.
2. Choose Start Recording from the Edit menu.
3. Drag the objects along the path you want them to follow, clicking frequently to record the movement.
4. Choose Stop Recording from the Edit menu.
5. In the script of the button that starts the animation, choose Paste Recording from the script editor's Edit menu..
strChecked
strChecked
scriptRecorderPopup2
false
visited
Guidelines for using the script recorder:
The main advantage of the script recorder is that you can create animation without writing scripts. However, there are also disadvantages:
Difficult to modify To change a recorded animation, you must either edit the script ToolBook created or record the animation again.
Difficult to create smooth movement It may be hard to create uniform spacing and direction between each step of the animation.
If you need to create smooth, easily modifiable animation, you may want to examine the topics in the Useful Scripts section of this book.......
strChecked
strChecked
tableOfContents
false
visited
Guidelines for using the script recorder:
The main advantage of the script recorder is that you can create animation without writin
Terminal
Courier
Move command
Moving objects
myChapter
myChapterID
false
visited
chapterCount
topicCount
Move command
label
strChecked
Moving an object involves setting its position property for each step of the animation. Usually this is accomplished in a loop structure, such as step or while.
The commands to use for moving an object are move to and move by.
Toolbook uses page units as the unit of measure to specify position.lled page units...
pageUnitsPopup
buttonclick
buttonclick
"pageUnitsPopup"
strChecked
strChecked
Move <object> to <position>
This command moves the specified object to the position supplied, for example:
move polygon "x" to 0,0
Moves it to the upper-left corner of the screen.een..
raisedField
tbk_wid_name
faceColor
highlightColor
shadowColor
tbk_wid_props
color,hls
color,hls
color,hls
tbk_wid_values
strChecked
highlight
strChecked
move toe Commandperty
shadow
strChecked
move toe Commandperty
strChecked
move toe Commandperty
raisedField
tbk_wid_name
faceColor
highlightColor
shadowColor
tbk_wid_props
color,hls
color,hls
color,hls
tbk_wid_values
strChecked
highlight
strChecked
move bye Commandperty
shadow
strChecked
move bye Commandperty
strChecked
move bye Commandperty
strChecked
Move <object> by <amount>
This command moves the object by the x and y amounts supplied, for example:
move polygon "x" by 45,60
Moves it 45 page units to the right and 60 down. s downits down
Hiding and showing
Move by command
Moving objects
myChapter
myChapterID
chapterCount
topicCount
visited
Move by command
label
Use the move by command when you want to move an object relative to its current position. For example, the command "move rectangle id 1 by 45,90" would move this object 45 page units to the right and 90 page units down.
This example uses move by in a loop to move the golf ball into the hole. The amount that the ball moves for each loop is calculated from the positions of the two objects. Note that the ball goes into the hole no matter where it starts from.
out,true
ThreeDeeRect
bottomLine
topLine
in,true
ThreeDeeRect
bottomLine
topLine
green
.animate
buttonup
-- sends the animate message handled
out,false
ThreeDeeRect
bottomLine
topLine
Animate
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
false
strChecked
strChecked
command
Animating buttons
Creating animated buttons
Move to command
orbit
moonRef
animate
-- moves the
along
animate
-- optimization: store
{reference
%we will
-- be refering
moonRef =
sz =
-- we are going
walk
, so let's
-- cache them
vs =
"orbit"
come
a list
pairs
-- one
each vertex. For
iteration
loop,
-- we
grab
y positions
E, subtract half
ball's
positioning relative
that
(vs)
Moving objects
myChapter
myChapterID
chapterCount
topicCount
visited
Move to command
label
Use move to to move an object to a specific place. This is useful when the animated path of one object is relative to the positions of other objects.
The example at the right shows a moon orbiting a planet. The path that the moon follows is not an ellipse; it's a polygon with 50 vertices. The example script simply moves the moon object to each vertex of the polygon, one after the other.ther.
out,true
ThreeDeeRect
bottomLine
topLine
in,true
ThreeDeeRect
bottomLine
topLine
orbit
.animate
buttondown
-- sends the animate message handled
out,false
ThreeDeeRect
bottomLine
topLine
Animate
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
false
strChecked
strChecked
command
Moving on idle
Moving objects
myChapter
myChapterID
false
visited
Moving on idle
label
strChecked
Whenever ToolBook is not running scripts, it receives the idle message. If you want an animation to run constantly while nothing else is happening, you can trigger each step of the animation upon the idle message.
The advantage to animation driven by the idle message is that you can interrupt the animation at any time to interact with other parts of the application. The key is to handle only one "step" of the animation per execution of the idle handler.....
in,true
ThreeDeeRect
strChecked
ballbounds
strChecked
bottomLine
strChecked
topLine
strChecked
in,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
strChecked
The bouncing ball moves by a small amount upon each execution of the idle handler. Note that you can press any of the buttons on the tool bar or go to another application at any time.during this animation.
elapsedTime
curDir
vector
maxBounce
-150,13,1
myInfo
strChecked
Moving on Idle
Frame animation
My Dogs
pageCaption
Frame animation
myChapter
myChapterID
myPages
chapterCount
topicCount
Frame animation
label
visited
strChecked
A common method to display a complex animation is to create several frames and show them in a series, similar to the way a movie works. This section covers the basics of frame animation..
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
F V J
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
trailerCountdown
lastTime
myAngle
strChecked
strChecked
strChecked
strChecked
minute
strChecked
counter
strChecked
enterpage
10,11,12
Frame Animation
How it works
mation works
$('x(
Jerry
pageCaption
Frame animation
myChapter
myChapterID
selectChars
chapterCount
topicCount
visited
How it works
label
strChecked
To create frame animation, you display a series of images quickly in sequence, each one slightly different than the one preceding it. The differences between the frames cause the object's apparent movement.
The animation at the top is a series of sixteen paint objects, shown individually below.
objects
Setting resources
Page flippingetting resources
Page flipping
strChecked
out,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
strChecked
N ^ J
strChecked
out,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
strChecked
strChecked
strChecked
strChecked
curFrame
myCurFrame
myCurFrame
newFrame
hides
shows frames (paintobjects)
the globe animation.
-- The paintObjects are named "1"
notifybefore
numFrames = 16 --
curFrame = myCurFrame
-- currently showing
newFrame =
-- store
myCurFrame
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
\ l J
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
2%B%J
in,true
ThreeDeeRect
strChecked
strChecked
$"&2&
bottomLine
Z&j&J
strChecked
topLine
strChecked
widget slows down everything,
notifybefore
2(>(mp
L(\(J
lastTime
strChecked
Slow-Mo
in,true
ThreeDeeRect
strChecked
strChecked
bottomLine
*0*J
strChecked
topLine
strChecked
V+f+J
strChecked
This globe animation is a series of paintObjects, shown one after the other.......the other.
curFrame
myCurFrame
mycurframe
highlight
newFrame
moves the
over
appropriate globe.
"globes are
numbered "1"
notifybefore
numFrames = 16 --
paintObjects
current
showing:
curFrame = mycurframe
newFrame =
myCurFrame
myCurFrame
strChecked
strChecked
strChecked
"222J
strChecked
83H3J
strChecked
+ 4&4
N4^4J
strChecked
+65<5
d5t5J
strChecked
+L6R6
strChecked
+b7h7
strChecked
+x8~8
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
6?F?J
strChecked
N@^@J
strChecked
highlight
<ALAJ
strChecked
false
How it works
content
toolbar
Hiding and showing
objects
Timothy
pageCaption
Frame animation
myChapter
myChapterID
chapterCount
topicCount
visited
Hiding and showing
label
strChecked
A common method for creating frame animation is to hide and show objects in a group using the hide and show commands.
This animation hides and shows one paint object after another. Each paint object shows the dog in a different position. A user property of the group keeps track of which frame is currently shown.
rts of the book, such as pressing the next page button.
out,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
curFrame
myCurFrame
myCurFrame
newFrame
-- This handler controls the animation
-- The
consists
18 paintobjects, named
-- 1
18, respectively. For each execution
(sent constantly
mode)
advanced one frame.
currently shown
stored
%a userProperty
notifybefore
numFrames = 18 --
paintObjects
ping
curFrame = myCurFrame
-- calculate
newFrame =
so we know what
curdog
lastTime
myCurFrame
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
2 ~
D T J
in,true
ThreeDeeRect
strChecked
strChecked
bottomLine
l!|!J
strChecked
topLine
strChecked
strChecked
The running dog above is a series of 18 frames, shown one after the other. Small differences in the t at least 30 milliseconds have passed before displaying the next frame. This way, no more that 24 frames per second
false
Animating buttons
buttons
.&, "
newcursor
curCursor
progressCursor
progressCursor
= cursor 0
maxCursor = 12
curCursor =
currentCursor =
newcursor = (
"+ 1)
newCursor
Frame animation
myChapter
myChapterID
chapterCount
topicCount
false
visited
Animating buttons
label
strChecked
Buttons can display bitmap resources, which are stored in the book. In its normal state, a button displays the bitmap resource specified by its normalGraphic property. When you press the button, the button displays its invertGraphic. You can use these properties to create an animation effect.
The button on the right displays an animation when clicked.en clicked.............property to display a series of bitmap resources.
The button on the right displays an animation when clicked.....
in,true
ThreeDeeRect
bottomLine
topLine
This button has two frames of animation: one specified by its normalGraphic, the other specified by its invertGraphic, which is displayed when clicked.
arrow
notifyBefore
normalgraphic
k6 + 1
bitmap ("arrow"&
notifyBefore
normalgraphic
k4 + 1
bitmap ("cd"&
in,true
ThreeDeeRect
bottomLine
topLine
These buttons set their normalGraphic property to a series of images.lGraphic, the other specified by its invertGraphic.
Position property
Useful scripts
Useful scripts
myChapter
myChapterID
14,15,16,17
myPages
chapterCount
topicCount
visited
Useful scripts
label
strChecked
This section contains reusable handlers you can use to make writing your animation scripts easier.
These buttons set their normalGraphic property to a series of images.lGraphic, the other specified by its invertGraphic.
Topics
tableOfContents
toolbar
leavepage
previous
topics
tableOfContents
toolbar
Table of contents
heading
enterPage
You cannot delete this page.
author
clear
ainitPage
-- enable table
contents
enabled
B"tableOfContents"
"toolbar"
pref =
pRef
"heading"
"Table
-- Don't allow deletion
"You cannot delete
qcutting
initialize
4we land on
initPage
strChecked
out,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
& : ~
L \ J
out,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
topic
raisedField
tbk_wid_name
faceColor
highlightColor
shadowColor
tbk_wid_props
color,hls
color,hls
color,hls
tbk_wid_values
strChecked
highlight
strChecked
Table of contents
shadow
strChecked
Table of contents
strChecked
Table of contents
strChecked
Click on one of the topics below to view information on that subject.ubject.
toolbar
ThreeDeeRect
out,true
bottomLine
topLine
strChecked
strChecked
strChecked
strChecked
strChecked
toolbar
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
tableOfContents
myChapter
myPages
chapterCount
topicCount
false
visited
24,27
selectChars
strChecked
tableOfContents
strChecked
strChecked
chapter1
How It Works 26
Hiding and Showing 25
Animating with Resouces 61
Page Flipping 62
Untitled 74
topics
pageID
strChecked
Moving objects
check1
strChecked
strChecked
chapter2
The Position Property 59
The Script Recorder 63
The Move Command 68
Move By 58
Move To 57
Moving on Idle 64
topics
pageID
strChecked
Frame animation
check2
strChecked
strChecked
chapter3
Timing Animation 66
Simulating Gravity 67
topics
pageID
strChecked
Useful scriptso
check3
strChecked
strChecked
chapter4
Chickens 26
Goats 25
topics
pageID
strChecked
Blahul Scripts
check4
strChecked
strChecked
chapter5
strChecked
check5
strChecked
strChecked
chapter6
strChecked
check6
strChecked
strChecked
chapter7
strChecked
check7
strChecked
strChecked
chapter8
strChecked
check8
strChecked
train
scriptRecorderPopup1
Moving objects
Moving objects
myChapter
myChapterID
3,4,5,7,6,8
myPages
chapterCount
topicCount
visited
selectChars
Moving objects
label
strChecked
Most animation involves moving an object from one place to another. The topics in this section discuss the various techniques for moving objects.
strChecked
placeholder
WjpositionChildViewer
train
<KinitAnimation
enterpage
train
leavepage
,%H.%
newbnds
positionChildViewer
.animate
train
serves
%the placeholder
train animation
-- on
opens
. On
sends
animate message
notifyAfter
initAnimation
positionChildViewer
-- close
notifyBefore
isOpen
-- sizes
specified
r childViewer, bnds
newbnds= pageUnitsToClient(
strChecked
strChecked
V f J
strChecked
leavepage
enterpage
Moving Objects
Move command
tv switch
Position property
Moving objects
myChapter
myChapterID
chapterCount
topicCount
false
visited
Position property
label
str_allback
searchString
37,48
selectChars
strChecked
Each object in ToolBook has a property called position that tells ToolBook where the object sits relative to the top and left edges of the page. Moving an object involves changing this property.
Position is a list of two numbers given in page units. In the illustration to the right, drag the object and notice how its position property changes.ow its position property changes..........................m the left side of page, and 865 page units from the top of the page.
Its position is "600,865" 865 page units from the top of the page.
Its position is "600,865"
pageUnitsPopup
buttonclick
buttonclick
"pageUnitsPopup"
strChecked
in,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
descr
strChecked
The position is 300,300. he illustration above is 1560,1455. ag the object{
strChecked
strChecked
strChecked
client
strChecked
strChecked
strChecked
ToolBook - POSITION.TBKign
strChecked
strChecked
strChecked
strChecked
File Edit View Page Object Draw
strChecked
3005page
yline
client
endpoint
endpoint
value
Znewb
cb =
client
xpix =
sysPageUnitsPerPixel
ypix =
b =
w =
v1 = x - w
v2 =
cb +
v3 = v1+w
v4 = y -
fref =
sz =
fpos = v3 +
*2,v2+(v4-v2)
y2 -
v4 - v2
strChecked
strChecked
centerLine
strChecked
xline
client
endpoint
endpoint
value
Znewb
xpix =
sysPageUnitsPerPixel
ypix =
cb =
client
b =
h =
v1 =
cb +
v2 = y - h
v3 = x -
v4 = v2 + h
fref =
sz =
fpos = v1+(v3-v1)
y2 -
y2,v4 +
v3 - v1
strChecked
strChecked
centerLine
strChecked
strChecked
3005page
strChecked
strChecked
strChecked
Move by command
scriptRecorderPopup2
Script recorder
Moving objects
myChapter
myChapterID
visited
Script recorder
label
strChecked
You can animate objects without writing scripts yourself by using the script recorder. This is useful when you want to animate one or more objects along an arbitrary path.
How to use the script recorder
When to use the script recorder
The animation to the right was created using the script recorder.
e objects around, dragging and dropping for each step of the animation.
4. Choose Stop Recording from the Edit menu.
5. In the script of the button that starts the animation, choose Paste Recording from the script editors Edit menu.