Skip to content

Can't click on a button added to a layer #2277

Closed Answered by rh101
aceinetx asked this question in Q&A
Discussion options

You must be logged in to vote

The mistake is here:

void MenuLayer::onEnter() {
    AXLOG("Parent: %p", this->getParent());
}

It should be:

void MenuLayer::onEnter() {
    Layer::onEnter();
    AXLOG("Parent: %p", this->getParent());
}

The same goes for any other methods that are overriden; don't forget to call the base class implementation unless there is a specific reason not to do so.

You can generally assume that functionality related to core engine features, like user input and such, would not have obvious issues like this, at least in common/typical cases of usage, so you can safely assume that the source of the problem would most likely be in the project code.

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@aceinetx
Comment options

Comment options

You must be logged in to vote
3 replies
@aceinetx
Comment options

@rh101
Comment options

rh101 Dec 15, 2024
Collaborator

Answer selected by aceinetx
@aceinetx
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants