hedgewars/uScript.pas
changeset 5825 a6eab1b7c00d
parent 5703 637fb1e6487b
child 5896 9ce1cf4e5a32
child 5897 0e0fc7e08a3d
--- a/hedgewars/uScript.pas	Fri Sep 09 03:57:45 2011 +0200
+++ b/hedgewars/uScript.pas	Fri Sep 09 15:36:30 2011 +0200
@@ -36,6 +36,7 @@
 
 procedure ScriptLoad(name : shortstring);
 procedure ScriptOnGameInit;
+procedure ScriptOnScreenResize();
 
 procedure ScriptCall(fname : shortstring);
 function ScriptCall(fname : shortstring; par1: LongInt) : LongInt;
@@ -1624,6 +1625,16 @@
 ScriptSetInteger('TeamsCount', TeamsCount)
 end;
 
+
+// Update values of screen dimensions and allow script to react to resolution change
+procedure ScriptOnScreenResize();
+begin
+ScriptSetInteger('ScreenHeight', cScreenHeight);
+ScriptSetInteger('ScreenWidth', cScreenWidth);
+ScriptCall('onScreenResize');
+end;
+
+
 procedure ScriptLoad(name : shortstring);
 var ret : LongInt;
       s : shortstring;