NPL_samplecode.lua

00001 --[[
00002 Authors: LiXizhi 
00003 Date: 2006.1.14
00004 Desc: Code snipets of NPL. 
00005 ]]
00006 
00007 -- activation function
00008 local function activate()
00009 end
00010 NPL.this(activate);
00011 
00012 --[[ 
00013 
00014 -- Reset game loop 
00015                 ParaGlobal.SetGameLoop("script/KidsMovie_Loop.lua");
00016 
00017 NPL.load("script/commonDialog.lua", false);
00018                 NPL.activate("(gl)script/pol_intro.lua", "INTRO_state=\"show\";");
00019                 
00020 -- ParaIO test examples
00021                 ParaIO.CreateNewFile("temp/test.txt");
00022                 ParaIO.WriteString("--comments \r\nHAHA line1\r\nHAHA line2\r\n");
00023                 ParaIO.CloseFile();
00024                 ParaIO.OpenFile("temp/test.txt");
00025                 local str = "test:\r\n";
00026                 repeat
00027                         ParaGlobal.log(str);
00028                         str = ParaIO.readline();
00029                 until (str==nil)
00030                 ParaIO.CloseFile();
00031 ]]

Generated on Mon Dec 1 14:34:40 2008 for NPL Scripting Reference for ParaEngine by  doxygen 1.5.2