iworld2d模块——2D UI画布类.
More...
List of all members.
Detailed Description
iworld2d模块——2D UI画布类.
绘制在UI层的2D场景画布. 提示: 1 请通过canvas_mgr进行创建和销毁.
2 该画布只用于UI,比如需要在UI上展示一个2D人物的属性等. 3 使用时请注意性能,请勿大量使用.每一个UI会有一个2D场景和一个flashui的消耗.
Member Function Documentation
将该 UI 设置为最上层.
可以在同depth的movie中置顶,但不会超过不同depth的movie,从而可以保持界面层次.
def set_movie_depth |
( |
|
self, |
|
|
|
depth = 0 |
|
) |
| |
设置该 UI 的层次,其他界面需要配合imovie_mgr.create_movie使用.
- Parameters:
-
depth | : int 指定movie所在的层次,数字大的在上面,例如:depth=10的会一直在depth=0的上面。默认值为0。 |
def set_pos |
( |
|
self, |
|
|
|
x, |
|
|
|
y |
|
) |
| |
设置 UI 的位置.
- Parameters:
-
x | : int 屏幕 x 坐标. |
y | : int 屏幕 y 坐标. |
def set_size |
( |
|
self, |
|
|
|
w, |
|
|
|
h |
|
) |
| |
设置 UI 的大小.
- Parameters:
-
w | : int 宽度. |
h | : int 高度. 默认大小为 1024*768 |
def set_view_size |
( |
|
self, |
|
|
|
w, |
|
|
|
h |
|
) |
| |
设置视口大小.
设置大小会改变画布的视口范围,默认为 1024*768.
- Parameters:
-
w | : int 宽度. 单位像素. |
h | : int 高度. 单位像素. |
def set_view_pos_center |
( |
|
self, |
|
|
|
x, |
|
|
|
y |
|
) |
| |
设置视口中心位置.
- Parameters:
-
x | : int x 坐标. |
y | : int y 坐标. |
def set_click_func |
( |
|
self, |
|
|
|
func = None , |
|
|
|
arg = None |
|
) |
| |
设置UI的鼠标左键点击响应函数.
- Parameters:
-
def set_right_click_func |
( |
|
self, |
|
|
|
func = None , |
|
|
|
arg = None |
|
) |
| |
设置UI的鼠标右键点击响应函数.
- Parameters:
-
def set_roll_over_func |
( |
|
self, |
|
|
|
func = None , |
|
|
|
arg = None |
|
) |
| |
设置UI的鼠标进入时的响应函数.
- Parameters:
-
def set_roll_out_func |
( |
|
self, |
|
|
|
func = None , |
|
|
|
arg = None |
|
) |
| |
设置UI的鼠标移出时的响应函数.
- Parameters:
-