GSPythonSource
所属分类:3D图形编程
开发工具:Others
文件大小:12KB
下载次数:1
上传日期:2007-03-09 20:18:28
上 传 者:
bie_zm
说明: GSPythonSource.zip :是采用acknex a6开发的3d图形
(GSPythonSource.zip : acknex A6 is the development of 3d Graphics)
文件列表:
GSPython.dpr (757, 2004-03-02)
GSPython.res (876, 2001-07-02)
gspython.wdl (5474, 2004-02-21)
gspythonu.pas (72322, 2004-02-21)
GSPython v0.93 *Compiled for A5.5+* *BETA*
http://www.peacekeeper.com/3dgs/
eli@peacekeeper.com
Use:
Free for all GameStudio projects without restrictions.
Disclaimer: If it blows up your machine it's not our fault.
Installation:
Unzip gspython.wdl into your templates directory.
Unzip GSPython.dll into your work directory.
Unzip Python23.dll into your bin directory.
Publishing:
You will have to copy the DLLs manually to your .cd directory when you publish.
Versions:
03/02/2004 -- v0.93 -- Added Python_Create() Python_Flags()
01/16/2004 -- v0.92 -- Added Python_LinkCStr()
-----------------------------Python_LinkTex()
-----------------------------Python_LinkBmap()
-----------------------------Python_LinkFont()
-----------------------------Python_LinkTxt()
-----------------------------Python_LinkPan()
-----------------------------Python_LinkView()
-----------------------------and all the .flags constants (see gspython.wdl).
01/13/2004 -- v0.91 -- Added Python_LinkEnt() and Python_LinkPar().
12/28/2004 -- v0.90 -- Beta Released.
Usage:
See gspython.wdl for a list of functions and their parameters.
Examples:
-------------
// Example #1
include ;
// Define a string for you to use. I default it to 1000 characters here.
string MyPythonString[1000];
text python_txt
{
layer = 1;
pos_x = 50;
pos_y = 50;
strings = 1;
font = standard_font;
string = MyPythonString;
alpha = 100;
flags = narrow, transparent, visible;
}
function EvaluatePython() {
dll_handle = dll_open("GSPython.dll");
// Fill our test string with something
str_cpy(MyPythonString,"123");
// Create
Python_Create();
//Initialize the Python Engine
Python_Init();
// Link MyPythonString to a string variable defined in Python named AckNexStr.
// Changes to one effect changes to the other.
Python_LinkStr("AckNexStr",MyPythonString);
// Evaluate code.
Python("
# Print goes nowhere right now
print 2+2
# Test the Acknex<->Python string interface
AckNexStr.Value = AckNexStr.Value + '456' + AckNexStr.Value
");
// Free the Python Engine
Python_Free();
dll_close(dll_handle);
}
-------------
// Example #2
include ;
// Assign the PythonEntity action to one of your models.
action PythonEntity
{
dll_handle = dll_open("GSPython.dll");
// Create
Python_Create();
//Initialize the Python Engine
Python_Init();
// Link "my" to a string variable defined in Python named AckNexEnt.
// Changes to one effect changes to the other.
Python_LinkEnt("AckNexEnt",my);
// Evaluate code.
Python("
# Make the entity red
AckNexEnt.lightrange=1
AckNexEnt.red=255
# Make the entity blue
#AckNexEnt.lightrange=1
#AckNexEnt.blue=255
# Make the entity green
#AckNexEnt.lightrange=1
#AckNexEnt.green=255
");
// Free the Python Engine
Python_Free();
dll_close(dll_handle);
}
-------------
// Example #3
include ;
// Assign the PythonWDLCall action to one of your models.
function pythonmsg() {
msg_show("python message test function",50);
}
action PythonWDLCall
{
dll_handle = dll_open("GSPython.dll");
// Create
Python_Create();
//Initialize the Python Engine
Python_Init();
// Evaluate code.
Python("
# Import the Acknex function module
import Acknex
# Call the wdlcall() function and pass it the name of the
# custom WDL function you want to call.
# Acknex.wdlcall() is NON-BLOCKING
Acknex.wdlcall('pythonmsg')
");
// Free the Python Engine
Python_Free();
dll_close(dll_handle);
}
近期下载者:
相关文件:
收藏者: