查看: 2353|回复: 1

[有事请教] 多个重叠的精灵按钮,点击时只执行最上面的,怎么做

[复制链接]
梦石
0
星屑
4134
在线时间
443 小时
注册时间
2015-4-4
回帖
117
发表于 2019-1-21 00:14:34 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
本帖最后由 玄羽 于 2019-1-22 00:26 编辑

Sprite_Button.prototype.processTouch = function() {
    if (this.isActive()) {
        if (TouchInput.isTriggered() && this.isButtonTouched()&&!this.isTransparency()) {
            this._touching = true;
        }
        if (this._touching) {
            if (TouchInput.isReleased() || !this.isButtonTouched()) {
                this._touching = false;
                if (TouchInput.isReleased()) {
                    this.callClickHandler();
                }
            }
        }
    } else {
        this._touching = false;
    }
};
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部