);
end;
procedure TScript.UnLoadScript; begin FCommandList.Clear; end;
end.
这里是测试代码。
procedure TGameMain.Button1Click(Sender: TObject); //请在form中放入一个button 后粘贴代码到单击事件中 var FScript : TScript; begin FScript := TScript.Create; FScript.LoadScript(''''E:\projects\GameEngine\Scripts\Test.src''''); //修改为你保存脚本的路径 (Sender as TButton).Enabled := FALSE; FScript.RunScript; //等待按键时只需要单击一下form即可继续运行。 (Sender as TButton).Enabled := TRUE; FScript.Free; end;
这里是关于上面代码的图解说明:
PrintString
NewLine
WaitForKeyPress
RunScript()
Text Console
阅读完上述的内容后,下一回将讲解如何解释向这样的脚本指令:
DrawBitmap "gfx/copyright.bmp" PlaySound "sound/ambient.wav" Pause 3000 PlaySound "sound/wipe.wav" FoldCloseEffectY DrawBitmap "gfx/ynh_presents.bmp" PlaySound "sound/ambient.wav" Pause 3000 PlaySound "sound/wipe.wav" FoldCloseEffectX DrawBitmap "gfx/title.bmp" PlaySound "sound/title.wav" WaitForKeyPress PlaySound "sound/wipe.wav" FoldCloseEffectY Exit
再见!2004年11月
上一页 [1] [2] |