background image
C H A P T E R 3
Views
About Views
3-23
Opening and Closing Animation Effects
3
Another attribute of a view that you can specify is an animation that occurs when
the view is opened or closed on the screen. If an effect is defined for a view, it occurs
whenever the view is sent an
Open
,
Close
,
Show
,
Hide
, or
Toggle
message.
Use the
viewEffect
slot to give the view an opening or closing animation.
Alternately, you can perform one-time effects on a view by sending it one of these
view messages:
Effect
,
SlideEffect
,
RevealEffect
, or
Delete
. These
methods are described in "Animating Views" (page 3-40).
The
viewEffect
slot specifies an animation that occurs when a view is shown or
hidden. If this slot is not present, the view will not animate at these times. There
are several predefined animation types. You can also create a custom effect using a
combination of
viewEffect
flags from Table 2-7 (page 2-86) in Newton
Programmer's Reference. To use one of the predefined animation types, specify the
number of animation steps, the time per step, and the animation type, with the
following values:
fxSteps(
x
)
In x specify the number of steps you want, from 1 to 15.
fxStepTime(
x
)
In x specify the number of ticks that you want each step to
take, from zero to 15 (there are 60 ticks per second).
Specify one of the following values to select the type of animation effect desired:
fxCheckerboardEffect
--reveals a view using a checkerboard effect, where
adjoining squares move in opposite (up and down) directions.
fxBarnDoorOpenEffect
--reveals a view from center towards left and right
edges, like a barn door opening where the view is the inside of the barn.
fxBarnDoorCloseEffect
--reveals a view from left and right edges towards
the center, like a barn door closing where the view is painted on the doors.
fxVenetianBlindsEffect
--reveals a view so that it appears behind
venetian blinds that open.
fxIrisOpenEffect
--changes the size of an invisible "aperture" covering the
view, revealing an ever-increasing portion of the full-size view as the aperture
opens.
fxIrisCloseEffect
--like
fxIrisOpenEffect
, except that it decreases
the size of an invisible "aperture" covering the view, as the aperture closes.
fxPopDownEffect
--reveals a view as it slides down from its top boundary.
fxDrawerEffect
--reveals a view as it slides up from its bottom boundary.
fxZoomOpenEffect
--expands the image of the view from a point in the
center until it fills the screen; that is, the entire view appears to grow from a
point in the center of the screen.
© 2007-2024, o7 studio » при воспроизведении материала сайта ссылка обязательна