客户端--2D场景编辑器 More...
Classes | |
class | ieditor2d |
2D 场景编辑器对外接口. More... | |
class | game_object |
游戏对象基类,用于关联自定义游戏类 More... | |
Functions | |
def | wpos2d_to_wpos3d |
将某层中的一个3D物体的2D世界坐标转为3D世界坐标. | |
Variables | |
EMPTY_OBJ = editor_const.EMPTY_OBJ | |
空场景物体类型. | |
IMAGE2D_OBJ = editor_const.IMAGE2D_OBJ | |
image2d场景物体类型. | |
MODEL2D_OBJ = editor_const.MODEL2D_OBJ | |
model2d场景物体类型. | |
SPRITE2D_OBJ = editor_const.SPRITE2D_OBJ | |
sprite2d场景物体类型. | |
MODEL3D_OBJ = editor_const.MODEL3D_OBJ | |
model3d场景物体类型. | |
ATTR_SCE_TYPE = editor_const.ATTR_SCE_TYPE | |
属性名称字符串:场景物体类型("sce_type"). | |
ATTR_POS = editor_const.ATTR_POS | |
属性名称字符串:2D世界位置("pos"). | |
ATTR_ROT = editor_const.ATTR_ROT | |
属性名称字符串:2D弧度("rot"). | |
ATTR_KEY_POINT = editor_const.ATTR_KEY_POINT | |
属性名称字符串:key点("key_point"). | |
ATTR_SCALE = editor_const.ATTR_SCALE | |
属性名称字符串:缩放("scale"). | |
ATTR_SIZE = editor_const.ATTR_SIZE | |
属性名称字符串:大小("size"). | |
ATTR_ALPHA = editor_const.ATTR_ALPHA | |
属性名称字符串:透明度("alpha"). | |
ATTR_RLEVEL = editor_const.ATTR_RLEVEL | |
属性名称字符串:深度("rlevel"). | |
ATTR_LAYER_ID = editor_const.ATTR_LAYER_ID | |
属性名称字符串:层号("layer_id"). | |
ATTR_NAME = editor_const.ATTR_NAME | |
属性名称字符串:游戏对象名称("name"). | |
ATTR_SCE_NAME = editor_const.ATTR_SCE_NAME | |
属性名称字符串:场景物体名称("sce_name"). | |
ATTR_PID = editor_const.ATTR_PID | |
属性名称字符串:标识符("pid"). | |
ATTR_3D_X = editor_const.ATTR_3D_X | |
属性名称字符串:3D坐标x("d3_x"). | |
ATTR_3D_Y = editor_const.ATTR_3D_Y | |
属性名称字符串:3D坐标y("d3_y"). | |
ATTR_3D_Z = editor_const.ATTR_3D_Z | |
属性名称字符串:3D坐标z("d3_z"). | |
ATTR_3D_ROT_X = editor_const.ATTR_3D_ROT_X | |
属性名称字符串:3D弧度x("d3_rot_x"). | |
ATTR_3D_ROT_Y = editor_const.ATTR_3D_ROT_Y | |
属性名称字符串:3D弧度y("d3_rot_y"). | |
ATTR_3D_ROT_Z = editor_const.ATTR_3D_ROT_Z | |
属性名称字符串:3D弧度z("d3_rot_z"). | |
ATTR_RES_PATH = editor_const.ATTR_RES_PATH | |
属性名称字符串:资源路径("res_path"). | |
ATTR_MODULE = editor_const.ATTR_MODULE | |
属性名称字符串:关联模块名称("module_name"). | |
ATTR_CLASS = editor_const.ATTR_CLASS | |
属性名称字符串:关联类名称("class_name"). | |
ATTR_USR_DATA = editor_const.ATTR_USR_DATA | |
属性名称字符串:自定义数据("usr_data"). | |
ATTR_COL_DATA = editor_const.ATTR_COL_DATA | |
属性名称字符串:碰撞数据("col_data"). | |
ATTR_COL_TYPE = editor_const.ATTR_COL_TYPE | |
属性名称字符串:碰撞体类型("iphy_type"). | |
ATTR_COL_PARAM = editor_const.ATTR_COL_PARAM | |
属性名称字符串:碰撞体参数("iphy_params"). | |
MAX_LAYER_NUM = editor_const.MAX_LAYER_NUM | |
最大支持16个层次编辑. | |
DEFAULT_GRID_W = editor_const.DEFAULT_GRID_W | |
默认格子宽 32. | |
DEFAULT_GRID_H = editor_const.DEFAULT_GRID_H | |
默认格子高 32. | |
SCREEN_W = editor_const.SCREEN_W | |
屏幕分辨率宽,1024,此处包括计算边框. | |
SCREEN_H = editor_const.SCREEN_H | |
屏幕分辨率高,768, 此处包括计算边框. | |
pid_not_exist = editor_exception.pid_not_exist | |
异常:不存在此pid. | |
COL_SPHERE = editor_const.COL_SPHERE | |
圆形Body. | |
COL_RECTANGLE = editor_const.COL_RECTANGLE | |
矩形Body. | |
COL_POLYGON = editor_const.COL_POLYGON | |
多边形Body. | |
JT_DIS = editor_const.JT_DIS | |
距离关节. | |
JT_REV = editor_const.JT_REV | |
旋转关节. | |
JT_PRIS = editor_const.JT_PRIS | |
移动关节. |
客户端--2D场景编辑器
def ieditor2d.wpos2d_to_wpos3d | ( | layer_id, | |
x, | |||
y, | |||
z | |||
) |
将某层中的一个3D物体的2D世界坐标转为3D世界坐标.
layer_id | :int 物体所在的层 |
x | : float 物体在2D世界坐标x |
y | : float 物体在2D世界坐标y |
z | : float 物体在3D世界坐标z,一般是要求3D物体会和2D物体在一个平面,所以该值要求为 2D平面在3D世界中的z值 |
EMPTY_OBJ = editor_const.EMPTY_OBJ |
空场景物体类型.
IMAGE2D_OBJ = editor_const.IMAGE2D_OBJ |
image2d场景物体类型.
MODEL2D_OBJ = editor_const.MODEL2D_OBJ |
model2d场景物体类型.
SPRITE2D_OBJ = editor_const.SPRITE2D_OBJ |
sprite2d场景物体类型.
MODEL3D_OBJ = editor_const.MODEL3D_OBJ |
model3d场景物体类型.
ATTR_SCE_TYPE = editor_const.ATTR_SCE_TYPE |
属性名称字符串:场景物体类型("sce_type").
ATTR_POS = editor_const.ATTR_POS |
属性名称字符串:2D世界位置("pos").
ATTR_ROT = editor_const.ATTR_ROT |
属性名称字符串:2D弧度("rot").
ATTR_KEY_POINT = editor_const.ATTR_KEY_POINT |
属性名称字符串:key点("key_point").
ATTR_SCALE = editor_const.ATTR_SCALE |
属性名称字符串:缩放("scale").
ATTR_SIZE = editor_const.ATTR_SIZE |
属性名称字符串:大小("size").
ATTR_ALPHA = editor_const.ATTR_ALPHA |
属性名称字符串:透明度("alpha").
ATTR_RLEVEL = editor_const.ATTR_RLEVEL |
属性名称字符串:深度("rlevel").
ATTR_LAYER_ID = editor_const.ATTR_LAYER_ID |
属性名称字符串:层号("layer_id").
ATTR_NAME = editor_const.ATTR_NAME |
属性名称字符串:游戏对象名称("name").
ATTR_SCE_NAME = editor_const.ATTR_SCE_NAME |
属性名称字符串:场景物体名称("sce_name").
ATTR_PID = editor_const.ATTR_PID |
属性名称字符串:标识符("pid").
ATTR_3D_X = editor_const.ATTR_3D_X |
属性名称字符串:3D坐标x("d3_x").
ATTR_3D_Y = editor_const.ATTR_3D_Y |
属性名称字符串:3D坐标y("d3_y").
ATTR_3D_Z = editor_const.ATTR_3D_Z |
属性名称字符串:3D坐标z("d3_z").
ATTR_3D_ROT_X = editor_const.ATTR_3D_ROT_X |
属性名称字符串:3D弧度x("d3_rot_x").
ATTR_3D_ROT_Y = editor_const.ATTR_3D_ROT_Y |
属性名称字符串:3D弧度y("d3_rot_y").
ATTR_3D_ROT_Z = editor_const.ATTR_3D_ROT_Z |
属性名称字符串:3D弧度z("d3_rot_z").
ATTR_RES_PATH = editor_const.ATTR_RES_PATH |
属性名称字符串:资源路径("res_path").
ATTR_MODULE = editor_const.ATTR_MODULE |
属性名称字符串:关联模块名称("module_name").
ATTR_CLASS = editor_const.ATTR_CLASS |
属性名称字符串:关联类名称("class_name").
ATTR_USR_DATA = editor_const.ATTR_USR_DATA |
属性名称字符串:自定义数据("usr_data").
ATTR_COL_DATA = editor_const.ATTR_COL_DATA |
属性名称字符串:碰撞数据("col_data").
ATTR_COL_TYPE = editor_const.ATTR_COL_TYPE |
属性名称字符串:碰撞体类型("iphy_type").
ATTR_COL_PARAM = editor_const.ATTR_COL_PARAM |
属性名称字符串:碰撞体参数("iphy_params").
MAX_LAYER_NUM = editor_const.MAX_LAYER_NUM |
最大支持16个层次编辑.
DEFAULT_GRID_W = editor_const.DEFAULT_GRID_W |
默认格子宽 32.
DEFAULT_GRID_H = editor_const.DEFAULT_GRID_H |
默认格子高 32.
SCREEN_W = editor_const.SCREEN_W |
屏幕分辨率宽,1024,此处包括计算边框.
SCREEN_H = editor_const.SCREEN_H |
屏幕分辨率高,768, 此处包括计算边框.
COL_SPHERE = editor_const.COL_SPHERE |
圆形Body.
COL_RECTANGLE = editor_const.COL_RECTANGLE |
矩形Body.
COL_POLYGON = editor_const.COL_POLYGON |
多边形Body.
JT_DIS = editor_const.JT_DIS |
距离关节.
JT_REV = editor_const.JT_REV |
旋转关节.
JT_PRIS = editor_const.JT_PRIS |
移动关节.