class FlatlandDemoScene2
Defined at line 12 of file ../../src/ui/examples/escher/rainfall/scenes/flatland_demo_scene2.h
Flatland Demo Scene which gives the illusion of endlessly
falling rectangles.
Public Methods
void FlatlandDemoScene2 (RainfallDemo * demo)
Defined at line 9 of file ../../src/ui/examples/escher/rainfall/scenes/flatland_demo_scene2.cc
void ~FlatlandDemoScene2 ()
Defined at line 11 of file ../../src/ui/examples/escher/rainfall/scenes/flatland_demo_scene2.cc
void Init ()
Initializes 100 rectangles with random colors,
widths between (100-230), heights between (70-150)
and with origin points above the top of the screen.
This function also gives every rectangle a variable
"fall" speed.
Defined at line 18 of file ../../src/ui/examples/escher/rainfall/scenes/flatland_demo_scene2.cc
std::vector<escher::Rectangle2D> & renderables ()
Defined at line 23 of file ../../src/ui/examples/escher/rainfall/scenes/flatland_demo_scene2.h
std::vector<escher::RectangleCompositor::ColorData> & color_data ()
Defined at line 25 of file ../../src/ui/examples/escher/rainfall/scenes/flatland_demo_scene2.h
void Update (const escher::Stopwatch & stopwatch)
On every update tick, update the origin-y component of each
rectangle by its fall speed. If the rectangle reaches the
bottom of the frame, transport it back up to the top of the
frame, with a new random position and color, to give the
illusion of a limitless number of rectangles that continue
to fall endlessly.
Defined at line 46 of file ../../src/ui/examples/escher/rainfall/scenes/flatland_demo_scene2.cc