Eusebia32 [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=32485 can't get btnp to call functions <p>I'm a new Pico-8 user. I feel like this should have some crazy obvious answer right in front of my nose.</p> <p>This function works fine if called in _draw(), but I cannot get a btnp to call it (or any other function) - </p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre> function test_swing() print(&quot;swing&quot;, 100, 100) end </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>The btnp code in _update() is</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre> if btnp(4) then test_swing() end </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>I would expect this to just flash up briefly at the 100,100 coordinate on the button press (z). Calling it<br /> in _draw() prints it to the screen continuously as expected. Any ideas? Thanks</p> https://www.lexaloffle.com/bbs/?tid=32187 https://www.lexaloffle.com/bbs/?tid=32187 Mon, 05 Nov 2018 12:59:24 UTC