Poco. Perform click on element

Hello. How can i perform click on an element of menu in defold-axamples project? E.q. physics. When I run poco(“physics”).click() there was an error (no element present I think). Most likely this command must work: poco(“physics/dynamic”).click() but it has no effect too. Though it has no error. But I wonder how to perform click in 1-level menu button. It’s possoble?

2 Likes

Have you verified the node names?
What if you dump the current scene graph?
example_dump.py

1 Like

Sorry, but don’t know what is verify.
Dump of root scene:
defold-examples-dump.txt (108.3 KB)

poco(“physics/dynamic”).click()

Looking at your dump, the reported position is at 0,0. I think it’s a bit unlikely that you have a button in the absolute corner of your window?

But I wonder how to perform click in 1-level menu button. It’s possoble?

Yes. See the examples folder, which contains examples from the example app.
These examples start by clicking the gui buttons (one different button to load the collection for each example).

1 Like

In poco examples I see that button ‘bn_level1/larrybutton’ it’s gui button (/dirtylarry/button.gui). But in defold-examples I see that all elements linked with their root elements. Seems to me it’s like folder tree. If I understand structure correctly. Same I see in project folder (examples/physics/debug). So It’s unclear how to click on root element.