Click here to Skip to main content
15,887,746 members
Articles / Desktop Programming / MFC
Article

CStarWarsCtrl - Star Wars Credits Control

Rate me:
Please Sign up or sign in to vote.
4.95/5 (14 votes)
17 Jul 2002 208K   4.2K   77   36
This is an attempt to create a control which looks like the credits of the Star Wars movies.

Sample Image

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:

  1. Insert the .h and .cpp files into your project.
  2. Add a static control into your dialog resource.
  3. Add a member variable for that static control.
  4. Initialize the eventsink
  5. Modify the variable declaration.

  6. Change this:
    CStatic m_StarWarsCtrl; 
    To this:
    CStarWarsCtrl m_StarWarsCtrl; 
  7. In your InitDialog message handler set the speed and add some text. Use these member functions:
  8. 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.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Netherlands Netherlands
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralRe: I like it Pin
WREY21-Jul-02 23:40
WREY21-Jul-02 23:40 
GeneralRe: I like it Pin
Luis Alonso Ramos28-Jul-02 9:47
Luis Alonso Ramos28-Jul-02 9:47 
GeneralRe: I like it Pin
WREY28-Jul-02 20:12
WREY28-Jul-02 20:12 
GeneralRe: I like it Pin
NGS 54967229-Jul-02 7:10
NGS 54967229-Jul-02 7:10 
GeneralRe: I like it Pin
G. Steudtel21-Aug-03 1:15
G. Steudtel21-Aug-03 1:15 
GeneralRe: I like it Pin
WREY21-Aug-03 8:37
WREY21-Aug-03 8:37 
GeneralRe: I like it Pin
Zerox77713-Sep-03 11:29
Zerox77713-Sep-03 11:29 
GeneralRe: I like it Pin
14-Sep-03 14:11
suss14-Sep-03 14:11 
I don't know which dimension you're in, but if it's the '3rd', let's begin with:

E = mc²

Energy is equal to matter times the speed of light squared. If you think the equation is right, then clearly you can see that matter is an integral part of Energy. IOW, you cannot have Energy without matter as you cannot have matter without Energy.

If you think the equation is wrong, then let's see the correct one, and let's hear why you think Einstein and the thousands of other physicists (like him) who have subjected the equation to all sorts of rigorous test, are wrong!! Show us what you know for a fact is the correct one.

For you to say that, "energy isn't always matter," sounds like you're saying that, "sometimes Energy is matter, and at other times Energy isn't matter." That sounds to me like you're saying, "energy is a variable" (that sometimes it's one thing, but at other times it's something else). If that's the case, then Einstein's equation is wrong, because at one time:

E = mc²

would be right, and at other times, the equation would be:

Ev = mc²

would be right (showing Energy as a variable), which means we'd have two distinct 'Energies' (one for when it's matter, and the other for when it's NOT matter). Now all of a sudden, the Universe is comprised of two different kinds of 'Energies'.

So let me ask you, "Which one of these is the one that produces heat?"

"And where does that energy (the one that produces heat) gets its energy to produce heat?"

Would that be from itself? Like the sun?

That couldn't be right, because the sun is made up of gravitational matter so dense, you would not be able to move or pick up a piece of it the size of a button!!

So which would be coming from the sun? Heat? or Energy?

That would have to be energy, because (according to you) heat is what comes from energy, and now we are left with energy coming from heavy gravitational matter. WOW!!!

Are you sure you're living in the 3rd dimension? HELLO!!!

Suspicious | :suss:


William

Fortes in fide et opere!
GeneralRe: I like it Pin
doublej13-Feb-04 3:59
doublej13-Feb-04 3:59 
GeneralRe: I like it Pin
Riceking16-Jun-05 10:25
Riceking16-Jun-05 10:25 
GeneralRe: I like it Pin
Adam °Wimsatt28-Oct-03 11:15
Adam °Wimsatt28-Oct-03 11:15 
GeneralRe: I like it Pin
Colin Leitner29-Jul-02 7:28
Colin Leitner29-Jul-02 7:28 
GeneralVery nice Pin
Michael P Butler18-Jul-02 23:15
Michael P Butler18-Jul-02 23:15 
GeneralYeah... Pin
Stefan Spenz18-Jul-02 23:12
Stefan Spenz18-Jul-02 23:12 
GeneralA Real Beauty Pin
Santosh Rao18-Jul-02 18:25
Santosh Rao18-Jul-02 18:25 
GeneralExcellent! Pin
Ravi Bhavnani18-Jul-02 17:51
professionalRavi Bhavnani18-Jul-02 17:51 
GeneralThis is so cool! Pin
Jason Henderson18-Jul-02 17:49
Jason Henderson18-Jul-02 17:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.