add 'onrightclick' uinode event
This commit is contained in:
@@ -69,6 +69,11 @@ UINode* UINode::listenAction(const onaction& action) {
|
||||
return this;
|
||||
}
|
||||
|
||||
UINode* UINode::listenRightClick(const onaction& action) {
|
||||
rightClickCallbacks.listen(action);
|
||||
return this;
|
||||
}
|
||||
|
||||
UINode* UINode::listenDoubleClick(const onaction& action) {
|
||||
doubleClickCallbacks.listen(action);
|
||||
return this;
|
||||
@@ -88,6 +93,12 @@ void UINode::click(int, int) {
|
||||
pressed = true;
|
||||
}
|
||||
|
||||
void UINode::clicked(Mousecode button) {
|
||||
if (button == Mousecode::BUTTON_2) {
|
||||
rightClickCallbacks.notify(gui);
|
||||
}
|
||||
}
|
||||
|
||||
void UINode::doubleClick(int x, int y) {
|
||||
pressed = true;
|
||||
if (isInside(glm::vec2(x, y))) {
|
||||
|
||||
Reference in New Issue
Block a user