我想在PIXI.Graphics()对象上使用一个简单的工具提示-一个矩形。
我尝试了tooltip.js(https://popper.js.org/tooltip-documentation.html),由于我的参考对象不是HTMLElement,因此无法正常工作。
let rectangle = new PIXI.Graphics();
rectangle.drawRect(100, 50, 50, 20);
rectangle.interactive = true;
const tooltip = new Tooltip(rectangle, {title: "test1"});
rectangle.on('mouseover', (event) => {
tooltip.show();
});
rectangle.on('mouseout', (event) => {
tooltip.hide();
});
是否可以使用并且仍然使用我的PIXI.Graphics()对象的库?还是我必须编写自己的不依赖HTMLElement的工具提示?