- 授权协议: GPL
- 开发语言: JavaScript
- 操作系统: 跨平台
- 软件首页: https://github.com/zhangkailin/ShapeTouch
- 软件文档: https://github.com/zhangkailin/ShapeTouch/blob/master/README.md
软件介绍
ShapeTouch
ShapeTouch 该Javascript库用于实现H5中不规则图形按钮可点击区域的判断,特别用于H5游戏中的某些场景。
API 调用接口
king.shape.touch(src,x,y,callback) king.shape.touchPoint(src,point,callback)
point对象示例:
The point object like this:
{x:9,y:25}Return 返回值
Object {touch: true, alpha: 255} Or Object {touch: false, alpha: 0}touch为true时,该点非透明,点击生效,alpha值大于0,touch为false时,该点透明,alpha为0.
(开发者也可以根据alpha的值自行判断点击是否生效)
The touch is true, the point is not transparent, the alpha value is greater than 0.
Use 使用
Html:添加引用后直接使用
<script type="text/javascript" src="ShapeTouch-min.js"></script>
<script type="text/javascript">
(function() {
king.shape.touch('images/logo.png',20,40,function(result){
console.log(result);
});
});
</script>Cocos creator:将文件放入assets即可,不需require
this.node.on('touchend', function (event) {
var touchPoint = event.getLocation();
var node = event.currentTarget;
var nodePoint = node.convertToNodeSpace(touchPoint);
var nodeSrc = node.getComponent(cc.Sprite).spriteFrame.getTexture().url;
king.shape.touchPoint(nodeSrc,nodePoint,function(result){
console.log(result);
});
}, this);
大型分布式网站架构设计与实践
陈康贤 / 电子工业出版社 / 2014-9-1 / 79.00元
《大型分布式网站架构设计与实践》主要介绍了大型分布式网站架构所涉及的一些技术细节,包括SOA架构的实现、互联网安全架构、构建分布式网站所依赖的基础设施、系统稳定性保障和海量数据分析等内容;深入地讲述了大型分布式网站架构设计的核心原理,并通过一些架构设计的典型案例,帮助读者了解大型分布式网站设计的一些常见场景及遇到的问题。 作者结合自己在阿里巴巴及淘宝网的实际工作经历展开论述。《大型分布式网站......一起来看看 《大型分布式网站架构设计与实践》 这本书的介绍吧!
