Board index » delphi » Easter Egg Code
Dave de Buys
![]() Delphi Developer |
Dave de Buys
![]() Delphi Developer |
Easter Egg Code2003-08-28 10:14:13 PM delphi85 Greetings everyone, I gather most of you are aware of the Alt+JEDI or Alt+TEAM Alt+QUALITY easter egg in D5,D6, Delphi 7 (In IDE Help|About) does anyone know what component or where i could get source to display the same star wars type message in my application ? I have tried my usual group but no-one is aware of how it is done ? Dave |
Joris
![]() Delphi Developer |
2003-08-29 12:59:24 AM
Re:Easter Egg Code
"Dave de Buys" <XXXX@XXXXX.COM>writes
Quotedisplay the 24bits per pixel or 32bits per pixel format. - Build yourself a text bitmap. Make sure it is a dib. It might be best to make this a pure black and white dib. Or perhaps a 24 or 32 bits per pixel dib to also use anti-aliased font rendering... Draw your complete text on this text bitmap with standard GDI text rendering, black on white - Build yourself a temporary bitmap, size and bitdepth same as background bitmap. - Now loop through the animation. For each frame: - Copy the background bitmap onto the temporary bitmap. Use fast CopyMemory instead of GDI. - Loop through all the scanlines of temporary bitmap. For each scanline - Calculate what scanline of the text bitmap you will need. This will be a function of the animation frame time index, and the temporary bitmap scanline index. - Calculate what factor of horizontal shrinking of text you will need. This will be a function of the temporary bitmap scanline index. - Copy the text scanline onto the temporary bitmap scanline, such that - white background pixels in text scanline means just skip - black text pixels in text scanline mean change temporary bitmap scanline pixel to foreground text color - you increment pixel offsets to do the horizontal shrinking of the text that is needed - Display the temporary bitmap You could start with this, and next enhance it do render the text on the temporary bitmap in an anti-aliased manner, averaging multiple text pixels into one temporary bitmap pixel. Next, you may also want to add the fadding out effect on the top of the text plane. By fiddling with the functions used in the two lines that start with 'Calculate', you can also adjust angle, and speed and such. At that point, this should give you the exact same star-wars like results. Report back with intermediate results regularly. I think you will get lots of help here, this is fun! Joris |
Danny Thorpe
![]() Delphi Developer |
2003-08-29 01:23:15 AM
Re:Easter Egg Code
It's easier just to use OpenGL to render text on a 3D plane. ;>
-Danny |
Joris
![]() Delphi Developer |
2003-08-29 07:06:43 AM
Re:Easter Egg Code
"Danny Thorpe" <XXXX@XXXXX.COM>writes
QuoteIt's easier just to use OpenGL to render text on a 3D plane. ;> situation that is rather typical when using heavy stuff for tasks that can be equally well performed by relatively easy proprietary code. Did you think of adding the trouble you described to the equation before making the conclusion about what's easier? I don't wish to go into an argument, though. You may be right, OpenGL may be the shortest route. I couldn't say, I don't know OpenGL. Joris |
Alan Garny
![]() Delphi Developer |
2003-08-29 07:30:17 AM
Re:Easter Egg Code
"Joris" <XXXX@XXXXX.COM>writes
Quote"Danny Thorpe" <XXXX@XXXXX.COM>writes Cheers, Alan. |
Joris
![]() Delphi Developer |
2003-08-29 07:57:02 AM
Re:Easter Egg Code
"Bryan Valencia" <XXXX@XXXXX.COM>writes
QuoteZamples? Joris |
Danny Thorpe
![]() Delphi Developer |
2003-08-29 08:04:52 AM
Re:Easter Egg Code
"Joris" <XXXX@XXXXX.COM>writes
Quote"Danny Thorpe" <XXXX@XXXXX.COM>writes When you're done with the scanline rendering engine, all you have is scanlines. When you're done with implementing a scene in OpenGL, you have a 3D model to play around with. If you're really bored, you can toss a teapot in as well. (a little OpenGL joke) For example, while viewing the scrolling credits in the Delphi IDE, try pressing the arrow keys... -Danny |
Paul Nicholls
![]() Delphi Developer |
2003-08-29 08:30:04 AM
Re:Easter Egg Code
<G>I like the 'Use the Source, Luke' on the underside of the scrolling
text...neat! (use down arrow to flip over the scrolling text)... "Danny Thorpe" <XXXX@XXXXX.COM>writes Quote
|
Dave de Buys
![]() Delphi Developer |
2003-08-29 03:08:41 PM
Re:Easter Egg Code
Hi guys, thanks for all the comments thus far, the reason i didn't want to
go OpenGL is because i dont want to have to install any components, there are many other developers on the project and i don't necesarily want them to know about my egg :) i started giving the GDI rendering a bash, will let you know if there are any advances, any source samples would be appreciated, i do mainly OO GIS / Spatial mapping software, so this is rather new to me ... Dave |
Eric Grange
![]() Delphi Developer |
2003-08-29 03:22:48 PM
Re:Easter Egg CodeQuotebut I couldn't figure out why the OpenGL context refused to bind to a child |
Alan Garny
![]() Delphi Developer |
2003-08-29 06:04:06 PM
Re:Easter Egg Code
"Bryan Valencia" <XXXX@XXXXX.COM>writes
QuoteZamples? is to do... Cheers, Alan. |
Joris
![]() Delphi Developer |
2003-08-29 06:11:25 PM
Re:Easter Egg Code
"Paul Nicholls" <XXXX@XXXXX.COM>writes
Quote<G>I like the 'Use the Source, Luke' on the underside of the scrolling OK guys, if you all say so, I will take your word for it. Joris |
Danny Thorpe
![]() Delphi Developer |
2003-08-30 04:57:47 AM
Re:Easter Egg Code
"Dave de Buys" <XXXX@XXXXX.COM>writes
QuoteHi guys, thanks for all the comments thus far, the reason i didn't want to the Win32 OS (after Win95, anyway). -Danny |
Jens Gruschel
![]() Delphi Developer |
2003-08-30 05:58:38 AM
Re:Easter Egg CodeQuoteThere are no components to install to use OpenGL. OpenGL.dll is part of Jens |
Alan Garny
![]() Delphi Developer |
2003-08-30 06:26:05 AM
Re:Easter Egg Code
"Jens Gruschel" <XXXX@XXXXX.COM>writes
Quote>There are no components to install to use OpenGL. OpenGL.dll is part big thing and is so popular that I wouldn't worry at all. In the worst case, there will an Open Source community that will take over, be sure of that. Cheers, Alan. |