add onSelected callback to KissExtendedSprite

This commit is contained in:
2022-08-17 23:56:17 +00:00
parent 5af6236608
commit 81e35f61b8
2 changed files with 7 additions and 0 deletions

View File

@@ -109,6 +109,11 @@ class DragToSelectPlugin extends FlxBasic {
}
}
}
for (s in dragState.selectedSprites) {
if (s.onSelected != null) {
s.onSelected();
}
}
} else if (!rect.isEmpty) {
dragState.debugLayer.drawFlxRect(rect);
}

View File

@@ -138,6 +138,8 @@ class KissExtendedSprite extends flixel.addons.display.FlxExtendedSprite {
}
}
public var onSelected:Void->Void = null;
public function pixelPerfectDrag() {
return _dragPixelPerfect;
}