v1.8 (07.03.2010):
ADD: Two new events:
FocusLost,
FocusReceived, and a property -
bool Game.OnFocusLostPauseRenderer = bool value. (added by request of
2.0)
FocusLost - this event happens when your application(game) lost its focus.
FocusReceived - this event happens when your application receive focus back.
Game.OnFocusLostPauseRenderer - if set to true, when game lost focus it will stop("freeze", like original WME do), if false - game will continue work (but music/sounds will be paused). Using of this property not needed if you ok with current state(that game freeze when focus lost) of things.
These events are useful if you need something to do before game lost its focus. For example, show 'pause' menu.
Note: Better to be declared in game.script.
ADD: New function
bool Game.ScreenshotEx2(string filename, [int width = -1], [int height = -1], [int quality = 85], [bool AddDate = true], [bool SaveInDocs = true], [bool DoBMP = false], [string GameDirName = GAME_CAPTION_FROM_PROJECT_MANAGER], [bool Grey = false]). Differences from Game.ScreenshotEx:
1) If
DoBMP - false, function will save screenshots in JPG.
2) Screenshot file extension in
filename you
DON'T have to set, it will be added automatically, in depends of DoBMP (true - ".bmp", false - ".jpg").
3) In
width and
height you can set "-1", in this case for Width & Height will be taken game resolution (that you set in project manager).
4) If
AddDate - true, to filename will be added current date & time on this manner: Screenshot_dd-mm-yyyy_hh-mm-ss
5) If
SaveInDocs - false, screenshots will be created in current game directory, otherwise they will be created in user's My Pictures directory in this way: My Documents\My Pictures\\
GameDirName\..., by the default value for
GameDirName taken from
caption field in project manager.
6)
quality - quality of picture for jpeg format. Ignored if
DoBMP = true. Range of values - 0..100.
7) If
grey = true, screenshots will be monohromatic. Ignored if
DoBMP - true.
Example: Game.ScreenshotEx2("Screenshot", -1, -1, 85, true, true, true, "TestProject"); // a .bmp screenshot will be saved in "My Documents\My Pictures\TestProject\..."
or: Game.ScreenshotEx2("Screenshot"); // if you ok with other parameters.
or: Game.ScreenshotEx2("Screenshot", -1, -1, 85, true, false); // if you won't save screenshots in "My Documents\My Pictures", but in game exe's directory.
ADD: New property
bool Scene.ShowGeometryStats = bool value - show additional statistics of your hidden geometry in current scene. Explanation of abbreviations:
fn - currently loaded geometry file.
l - lights count
c - cameras count
m - meshes count
v - vertex count
t - triangles(polygons) count
This is how it looks:
if (Keyboard.KeyCode == VK_F1) Scene.ShowGeometry = !Scene.ShowGeometry;
else if (Keyboard.KeyCode == VK_F2) Scene.ShowGeometryStats = !Scene.ShowGeometryStats;
else if (Keyboard.KeyCode == VK_F3) Scene.ShowGeometryEx = !Scene.ShowGeometryEx;
ADD: New events
ScreenshotDone and
ScreenshotFail happens when Game.ScreenshotEx or Game.ScreenshotEx2 call is success. I don't think these events is needed because Game.ScreenshotEx/ScreenshotEx2 returns result of their call, but may be someone find them handy.
ADD: Properties
void Scene.GeomWalkplaneColor = string color_hex_without_0x and
void Scene.GeomGenericColor = string color_hex_without_0x. Waiting for color in hex, without 0x.
Example: Scene.GeomWalkplaneColor = "FF1EEC07"; // green.
ADD: New property
bool Scene.ShowGeometryEx = bool value - a bit more informative version of
Scene.ShowGeometry, with following differences:
1) You can set colors which will represent every object in your hidden geometry.
2) On left side you can see list of objects in your hidden geometry file.
This is how it looks:
Note #1: Of course you cannot use ShowGeometry and ShowGeometryEx in the same time. In this case ShowGeometryEx have higher priority. But you can freely switch between each other.
Note #2: This function has one limitation - supports not more than 20 colors. This is means that your geometry file should contain not more than 20 block-objects, otherwise use Scene.ShowGeometry.
Note #3: If you set wrong color, white will be used as default.
Note #4: If geometry file have objects more than you have set colors, black color will be used as default for these objects.
Note #5: All colors are hex-values without 0x. For convenience you can use mine Color Picker
*.
.
You can find it in
Tools directory.
Note #6: You have to use
void Scene.SetShowGeomExColors(array) to set colors.
Note #7: You must declare colors and apply them in "SceneGeometryLoad" event(otherwise user-custom colors will not work) (raised automatically in process of geometry file parsing). Example:
on "ScreenshotDone"
{
Game.Msg("Done", 3000, 500, 400, TAL_LEFT);
}
on "ScreenshotFail"
{
Game.Msg("Fail", 3000, 400, 500, TAL_LEFT);
}
on "SceneGeometryLoad"
{
var scngeomblkdobjsclrs; // Scene Geometry Blocked Objects Colors :-D
scngeomblkdobjsclrs[0] = "FFFD072D"; // 0, red
scngeomblkdobjsclrs[1] = "FFF107FD"; // 1, pink
scngeomblkdobjsclrs[2] = "FF3F07FD"; // 2, blue
scngeomblkdobjsclrs[3] = "FF07F7FD"; // 3, cyan
scngeomblkdobjsclrs[4] = "FF12CA03"; // 4, green
scngeomblkdobjsclrs[5] = "FFFEF306"; // 5, yellow
scngeomblkdobjsclrs[6] = "FFD6AC02"; // 6, orange
Scene.GeomWalkplaneColor = "FF16D300"; // green
Scene.GeomGenericColor = "FFE69C00"; // orange
Scene.SetShowGeomExColors(scngeomblkdobjsclrs);
}
ADD: New command line parameter
-windowedmode. "
game.exe -windowedmode" = game will run in windowed mode.
ADD: New function
Game.ShowScriptErrors(bool value). If value = true - instead of "Script runtime error" you will see error explanation (its also logged). Better to declare it somewhere in begin of game.script.
CHG: Property
Scene.ShowGeometry now save its state between scenes.
* - A little help for Color Picker:
а) use BGRA-mode (set up by default). RGBA - for html and so on.
б) if "auto copy" is enabled - generated hex value will be automatically copied to clipboard.
Links:
http://kinjal.apeironstudios.com/WME-KE_V18_DevKit_07mar2010.7z - binaries (install: copy files to engine folder with replace)
http://kinjal.apeironstudios.com/WME-KE_V18_Src_07mar2010.7z - sources.