Description
This is an attempt to create a control which looks like the credits of the Star Wars movies.
Only a few simple GDI functions are used to establish this effect: Ellipse
for the stars in the background and
StretchBlt
for scrolling text. The control is derived from CStatic
.
Usage
To use the class in your application you need to do the following:
- Insert the .h and .cpp files into your project.
- Add a static control into your dialog resource.
- Add a member variable for that static control.
- Initialize the eventsink
- Modify the variable declaration.
Change this:
CStatic m_StarWarsCtrl;
To this:
CStarWarsCtrl m_StarWarsCtrl;
- In your
InitDialog
message handler set the speed and add some text. Use these member functions:
m_StarWarsCtrl.SetStarSpeed(30);
m_StarWarsCtrl.SetScrollSpeed(2);
m_StarWarsCtrl.AddTextLine("A long time ago");
m_StarWarsCtrl.AddTextLine("");
m_StarWarsCtrl.AddTextLine("in a galaxy far far away");
m_StarWarsCtrl.AddTextLine("");
m_StarWarsCtrl.AddTextLine("this application was programmed by");
m_StarWarsCtrl.AddTextLine("");
m_StarWarsCtrl.AddTextLine("Pablo van der Meer");
m_StarWarsCtrl.AddTextLine("");
Contacting the Author
Please send any comments or bug reports to me via
email. For any updates to this article, check my site
here.