javascript - 有没有办法避免在 Pixi.js 中的同一位置绘制多个点?
问题描述
你知道是否有办法检查我在 pixi.js 中绘制图形的位置是否已经有另一个图形?
如果可能的话,我想做类似下面的事情。
const graphic = new PIXI.Graphics();
graphic.x = coords[0]
graphic.y = coords[1]
if (graphic.isExists) {
console.log("graphic already exists on the same location")
return
}else {
app.stage.addChild(graphic)
}
如果有办法做与上述类似的事情,您的建议将不胜感激。
解决方案
推荐阅读
- apache-kafka - Kafka Zookeeper 的用途
- android - 如何更新从 ADB android studio 生成的具有相同密钥存储的 APK 的 Play 商店下载的 APK
- node.js - express 和 CORS 的问题
- python-3.x - Splitting HSV mask into multiple rectangles
- go - go中如何使用runtime.Object创建CRD泛型函数
- javascript - 使用捕获的匹配作为键,用正则表达式替换字符串
- elasticsearch - 启动 ELASTICSEARCH 时,Elasticsearch 进程的最大文件描述符 [4096] 太低
- docker - Docker 应用程序中的 GUI
- c++ - 是否可以在 C++ 中转到更高级别的范围条件?
- amazon-web-services - AWS 简单电子邮件服务适用于本地主机,但不适用于生产 Amazon EC2 服务器