- 注册时间
- 2017-5-8
- 最后登录
- 2017-6-12
- 阅读权限
- 20
- 积分
- 22
- 精华
- 0
- 帖子
- 5
|
本帖最后由 openbug 于 2017-6-12 21:35 编辑
感谢这些快就回了,不过这个问题已经搞定了,
另外又发现一个问题:
下面代码红色部分,即button02.y = button01.height;按道理button02的y的位置,应在button01的下面,但是实际却是在它的中心还不到,不知道是不是个bug
,如何才能得到button01的实际高度.
//菜单初始化
function initMenu(event){
var button01 = new LButtonSample2("设置",10);
button01.backgroundColor = "#008800";
button01.width = 15;
button01.height = 15;
button01.x = 200;
button01.y = 0;
ctrlLayer.addChild(button01);
var button02 = new LButtonSample1("设置",12);
button02.backgroundColor = "#008800";
button02.width = 20;
button02.height = 200;
button02.x = button01.x
button02.y = button01.height;
button02.visible=false;
ctrlLayer.addChild(button02);
button01.addEventListener(LMouseEvent.MOUSE_UP,function(){button02.visible=true;});
button02.addEventListener(LMouseEvent.MOUSE_UP,function(){button02.visible=false;});
} |
|