Game Development Community

Recommendations for a Screen Capture utility on Win32

by Arthur Ogawa · in Torque Game Builder · 02/24/2007 (4:48 pm) · 2 replies

I have to document a manual I am writing (on the Gui Editor) with screen captures. It would be satisfactory to capture the whole window each time, but a requirement would be the ability to capture a screen where a menu is popped down with the mouse poised above one particular menu item.

Has anyone recommendations for doing this on Win32? Thanks for reading!

#1
02/24/2007 (6:17 pm)
Fraps is popular for this purpose, but there is also a screenshot function built into the engine as well. I think Ctrl-P is the default command for it.
#2
02/24/2007 (8:17 pm)
@Luke, thanks for the tip! I decided to look further into the built-in screenshot function.

I had a feeling I would not be able to simply use the key binding you gave, because I am running the Mac OS version. So, I started by grepping the source for "screenshot". I found in ./games/common/gameScripts/common.cs:
GlobalActionMap.bind(keyboard, "ctrl p", doScreenShot);
Then, I grepped "GlobalActionMap" and found in ./source/game/main.cc:
ActionMap* globalMap = new ActionMap;
globalMap->registerObject("GlobalActionMap");
So, I consulted the documentation for class ActionMap and found the following two class methods:
Quote:
bind( device, action, [modifier spec, mod...], command )
getBinding( command ) -> device TAB action
Then, I typed in at the console,
==>echo(GlobalActionMap.getBinding(doScreenShot));
keyboard^cmd p
And find that for me, the key is correct. Finally, I looked at the file ./games/common/gameScripts/screenshot.cs:
function doScreenShot(%val) {
...
      %name = expandFileName( "^game/data/screenshots/" @ formatSessionNumber
...
And my investigation was complete:

To get a screenshot, I press the key combination and the screenshot will be saved to my game's ./data/screenshots/ directory.

Sure enough, I shot the screen, and there was the file: ./data/screenshots/001-00000.png.