Mene-Mene![]() Member Posts: 1398 From: Fort Wayne, IN, USA Registered: 10-23-2006 |
I personally need some help making a screen saver for my father as its tomorrow. I've semi started programming it in Blitz Basic, I'm just missing a couple elements. Current Code in BB: Edit 2: Cut out for length reasons. That's the start anyway. Basically it picks a random word between the available words, splits it up into letters, and sends it going down the screen. But it goes both ways, and when the first letter hits the bottom of the screen, the letter that was going double speed, now goes normal, and it switches. That's my Idea, take it if you want, I don't really care what you say, except just report how it goes.
So to begin, I googled MSVC 6.0 and discovered it was Microsoft Visual C 6.0. Okay, so I downloaded the only available version, Microsoft Visual C++ Express. Great, looks nothing like his, and looks difficult to manage. Edit: BTW, the code looks nothing like the screensaver. While waiting I'm making a better Pseudo-type ------------------ [This message has been edited by Mene-Mene (edited June 16, 2007).] [This message has been edited by Mene-Mene (edited June 16, 2007).] |
|
SSquared![]() Member Posts: 654 From: Pacific Northwest Registered: 03-22-2005 |
Wow! That's a terrific idea! There is a sample Screen saver included with Visual C# Express and Visual Basic Express. Does not come with Visual C++ Express. You may want to give those a try. |
|
Mene-Mene![]() Member Posts: 1398 From: Fort Wayne, IN, USA Registered: 10-23-2006 |
Thanks for the info. This is almost theater-like. A child 12 years old, has been using computers since a toddler, making games for 2 years. Attempt to make a complex feat with a language just learning, never done graphics in it before, or a screensaver ever.... lol. Any help with anything would be awesome. ------------------ I reserve the full right to change my views/theories at any time. |
|
SSquared![]() Member Posts: 654 From: Pacific Northwest Registered: 03-22-2005 |
You are only 12? Let me know if you have any questions. I think the sample may have what you need. Just delete the code regarding the RSS functionality. |
|
Mene-Mene![]() Member Posts: 1398 From: Fort Wayne, IN, USA Registered: 10-23-2006 |
Yeah, I'm 12. Started at 10 though. Started Here at 11. A question, I've downloaded the C# thing, and attempting to learn. Is it basically any ordinary application but with a different extension? Does changeing the extension change anything with the program? ------------------ I reserve the full right to change my views/theories at any time. [This message has been edited by Mene-Mene (edited June 16, 2007).] [This message has been edited by Mene-Mene (edited June 16, 2007).] |
|
SSquared![]() Member Posts: 654 From: Pacific Northwest Registered: 03-22-2005 |
I'm not sure I understand your question. Are you referring to the .CS (C Sharp) extension or the EXE/SCR extension. C# files use the CS extension. The built application has a .EXE extension. When you are ready to install it as a screensaver, just change EXE to SCR and you can then use the Windows Screensaver to run your application. | |
Mene-Mene![]() Member Posts: 1398 From: Fort Wayne, IN, USA Registered: 10-23-2006 |
Thank you, I've gotten the Screen saver part mostly worked out then. Um, I'll be working on the program. ------------------ I reserve the full right to change my views/theories at any time. |
|
Briant![]() Member Posts: 742 From: Stony Plain, Alberta, Canada Registered: 01-20-2001 |
To answer your question about the articles: although Visual C++ 6.0 was used for the article (and code), it should be a very simple matter to use the code in 2005 Express. The screen shots would have to be updated, but the settings would be the same too, just configured in slightly different places in the IDE. You're the only person in about 3 or 4 years that has commented on or asked about the articles (that I know of), so that's why I didn't spend any time updating them yet. ------------------ Check out this webhost! Fantastic prices, features and support! |
|
Mene-Mene![]() Member Posts: 1398 From: Fort Wayne, IN, USA Registered: 10-23-2006 |
Thank You BrianT! I found the setting in DevC++. Here is the Pseudo-Code Updated:
I've got the make it into a screensaver part, but not the commandline, and change it into C++ part. I've never done graphics in C++ before so I'm having trouble. In the 2 languages i know, I can't set the extension. I reserve the full right to change my views/theories at any time. [This message has been edited by Mene-Mene (edited June 16, 2007).] |
|
SSquared![]() Member Posts: 654 From: Pacific Northwest Registered: 03-22-2005 |
If you plan on using C++ Express, don't forget you will also need to download the Win32 SDK: http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/ C++ Express is meant for creating .NET applications, but by installig the above package, you will be able to use regular ol' Win32. You will need this to match Brian's article. Win32 is Microsoft's C API set for creating Window applications. They later created Microsoft Foundation Classes (MFC) as their standard C++ way of developing. And now they have .NET. |
|
Mene-Mene![]() Member Posts: 1398 From: Fort Wayne, IN, USA Registered: 10-23-2006 |
Ah, that would help with his article. I'm still really blank on graphics. This is basically what I need right now. I used BB in order to write some pseudo code for the actual C++ code. I'm pretty much past that part, but I've never done graphics before, so I need some help with that, and I don't understand how to exit with moving the mouse. I also don't quite understand what window. I tried to learn what I could from your example but I'm kinda stuck, any help would be great. Do I need to make a Win32, or does it work with something else? ------------------ I reserve the full right to change my views/theories at any time. [This message has been edited by Mene-Mene (edited June 16, 2007).] [This message has been edited by Mene-Mene (edited June 16, 2007).] |
|
kenman![]() Member Posts: 518 From: Janesville WI Registered: 08-31-2006 |
Did screen savers in VB a long time Make your .exe file JUST rename the extension .scr OPening in the display control in the control panel and you are done. Best o luck to ya! |
|
Mene-Mene![]() Member Posts: 1398 From: Fort Wayne, IN, USA Registered: 10-23-2006 |
I tried doing that, but It will only create what my anti-virus calls, a hidden-extension. Oh, I just had the hide extension on. Fixing up Pseudo-Code to be in BlitzMax since I can't handle C++. Here's the latest: The line in bold is causing problems, its trying to convert a string array to a float, and i don't know why. I reserve the full right to change my views/theories at any time. [This message has been edited by Mene-Mene (edited June 16, 2007).] [This message has been edited by Mene-Mene (edited June 17, 2007).] |
|
SSquared![]() Member Posts: 654 From: Pacific Northwest Registered: 03-22-2005 |
I still think you should use the C# Screensaver example. It's complete. Wiggle the mouse and it goes away. It has everything you need. Take the example and change the following code. In the file ScreenSaverForm.cs, there is a method called OnPaint. Replace it with this:
Just comment out the RSS code. The background pictures are actually quite fitting for Father's Day. The above code will actually draw the items rather quickly. To fix this, create member variables to hold the choice, xPoint, and yPoint. Then, create the random numbers in backgroundChangeTimerTick (the method just below OnPaint) and continue to call DrawString in your OnPaint, but use the member variables in your call. For some added effect, you can uncomment rssView.Paint or the other one (if you want). Then, right-click on the 'Paint' part of rssView.Paint and select 'Go To Definition'. In Paint is DrawItemTitle. Right-click and go to definition. There is a for loop in there with the comment //Draw the title of the item. You can use this as a place to type in some bible verses. Anyway, just some ideas. Let me know if you have any more questions. Hopefully you can get this done by tomorrow. |
|
Mene-Mene![]() Member Posts: 1398 From: Fort Wayne, IN, USA Registered: 10-23-2006 |
I don't know C#, so it looked especially foreign to me. And I'm not really looking to make him a fathers day screensaver, but rather one I made. ------------------ I reserve the full right to change my views/theories at any time. |
|
SSquared![]() Member Posts: 654 From: Pacific Northwest Registered: 03-22-2005 |
OK. I don't know BB, so I couldn't help in that direction. In any case, I'm sure your dad will enjoy it. Like I said, I think it's a nice idea! Have fun with it! |
|
Mene-Mene![]() Member Posts: 1398 From: Fort Wayne, IN, USA Registered: 10-23-2006 |
Thanks! ------------------ I reserve the full right to change my views/theories at any time. |
|
Briant![]() Member Posts: 742 From: Stony Plain, Alberta, Canada Registered: 01-20-2001 |
Hey Mene-Mene, I'll help as I can, but remember I'm not a Blitz or VB programmer. For exiting by moving the mouse: at the beginning of your program, get the current mouse position like this: origMouseX=MouseX() Then, I would add something like the following to your main loop: button=GetMouse() In other words, all you're doing is detecting if the mouse buttons were pressed, if the mouse moved, or if a key was pressed. If so, then exit the program. For graphics, I would use something like DrawImage. There is a good simple example at: http://www.blitzbasic.com/b3ddocs/command.php?name=DrawImage&ref=2d_cat . In this example, the While loop at the bottom is where you would put your mouse movement detection stuff. ------------------ Check out this webhost! Fantastic prices, features and support! |
|
Mene-Mene![]() Member Posts: 1398 From: Fort Wayne, IN, USA Registered: 10-23-2006 |
Thank you for your time. I was actually C++ in finding difficulty in graphics. I didn't notice the function you mentioned for getting any key, thanks! I was actually wondering before if there was a special thing for screensavers, but from the context of your message it seems to say otherwise. This is the new code, still stuck on that error. I reserve the full right to change my views/theories at any time. [This message has been edited by Mene-Mene (edited June 16, 2007).] [This message has been edited by Mene-Mene (edited June 17, 2007).] |
|
Briant![]() Member Posts: 742 From: Stony Plain, Alberta, Canada Registered: 01-20-2001 |
Graphics in C++ is quite a bit more complicated than in BB, mostly because C++ on it's own doesn't do graphics - you have to choose from various libraries and APIs to use, and they can be very different from each other. For basic Microsoft Windows graphics, the "GDI" (graphics device interface) is how to draw basic windows, buttons, bitmaps, etc. "GDI+" gives you a lot more control and features (I think it's a layer on top of DirectX). You can also use DirectX or OpenGL. You can even access the video RAM directly, but nobody does that anymore. ![]() The example in the articles I wrote for this site simply use Windows GDI. As far as screen savers go, there's really nothing special about them - they are just normal programs with a .scr extension instead of .exe. On thing screen savers SHOULD have though (though not required) is to accept command line parameters: /c to start in "configure" mode (i.e. let the user change settings, etc.) Once your screen saver app has been placed in the Windows system folder (c:/windows/system32), it will be detected and shown in the screen savers list. Windows will pass it those above command line parameters depending on how it wants you to start, but it's up to you to do it or ignore the request and simply start how you want. ------------------ Check out this webhost! Fantastic prices, features and support! |
|
Briant![]() Member Posts: 742 From: Stony Plain, Alberta, Canada Registered: 01-20-2001 |
quote: I'm not sure how DrawText works, but it looks like you have the parameters in the wrong order. You have x, y, "text" but some samples I found via Google have "text", x, y. ------------------ Check out this webhost! Fantastic prices, features and support! |
|
Mene-Mene![]() Member Posts: 1398 From: Fort Wayne, IN, USA Registered: 10-23-2006 |
Funny thing is, I just thought of that. The old Text function was x,y,$ But this is $,x,y Alright, past due date, but I'm trying to make this still go on for a belayed FD Present. Problems: Current Code:
[This message has been edited by Mene-Mene (edited June 17, 2007).] [This message has been edited by Mene-Mene (edited June 17, 2007).] |
|
Briant![]() Member Posts: 742 From: Stony Plain, Alberta, Canada Registered: 01-20-2001 |
Altering example I found on the website, try this:
Note especially the Flip. ------------------ Check out this webhost! Fantastic prices, features and support! |
|
Mene-Mene![]() Member Posts: 1398 From: Fort Wayne, IN, USA Registered: 10-23-2006 |
I tried that, and I'm pretty sure it crashed my computer, it may be a loop leak. I'll look for the time where a similar problem occured, I think it had to do with either WoB or my programming challenge game. ------------------ I reserve the full right to change my views/theories at any time. |