This is an attempt to create a control which looks like the credits of the Star Wars movies. I’ve used a few simple GDI functions to establish this effect: Ellipse() for the stars in the background and StretchBlt() for scrolling text. The control is devired from CStatic.
Here is how you use this class:
- 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.
- Modify the variable declaration.
- In your InitDialog message handler set the speed and add some text. Use these member functions:
Change this:
CStatic m_StarWarsCtrl;
To this:
CStarWarsCtrl m_StarWarsCtrl;
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(“”);
For more cool projects visit: Pablo Software Solutions.