Log In  

The regular poke memory method to get the coordinates of mouse in pico-8 doesn't work in Picotron, and I want to add buttons that can react to the clinking in my programs, any examples?
usually while I was working in pico-8, I used to create and object and follows the the mouse, and as the object collides with sth, program runs , but can't detect clinking.

P#146419 2024-04-12 02:17

2

mouse is the new function for detecting mouse info. For example:

mx,my,mb=mouse()
mlb=mb&1>0
mrb=mb&2>0
mmb=mb&4>0

There's also key and keyp for detecting held/pressed keyboard keys.

P#146425 2024-04-12 02:28

@Kaius That helps, is these any source of information of new features and functions? So no need for me to keep asking simple questions in community ;)

P#146428 2024-04-12 02:33
1

@Alpaca_Killer at the moment there isn't any complete documentation.
But the EnView cart and the Wiki cart can help you.
What we're doing to make our projects is reading the Picotron's apps source code.
You can find a lot in system/ to learn how to do things.
Basic rule is: if Picotron does it, your carts can do it too.

For Picophone what I did is:
mx, my, mb = mouse() to get mouse x, mouse y, and mouse button state.
After that I just made the buttons using rect(), rectfill(), circ(), cricfill() ecc.

Then I just check if mb>0, which means if any mouse button has been pressed.

If it has been pressed, I check if mx and my (mouse's positions) are inside any button I just made.

If this condition is true too, then I make something happen.

This is just the surface doe, you have to experiment and look into Picotron default apps to understand every concept you need. Also lots of things are Pico8 related, so reading the Pico8 documentation can be beneficial to you if you haven't already, but remember, not everything you do in Pico8 is done in the same way in Picotron.

P#146448 2024-04-12 11:24 ( Edited 2024-04-12 13:38)
1

@369369369 Thank you for your helping and idea! And your Picophone program is such a perfect and simple example of its logic!

P#146454 2024-04-12 12:30 ( Edited 2024-04-12 12:31)
2

to complement this:

> What we're doing to make our projects is reading the Picotron's apps source code.

«we» is a big group on discord! people also post on mastodon, but in-depth discussion and help is on discord: https://discord.gg/XQStcpPeH4

P#146469 2024-04-12 16:33

"nEW lOcATiOn check yOUr eMAiL"
:(

P#146509 2024-04-13 01:12

@Alpaca_Killer thank you! It's a pleasure knowing someone finds it useful.
Hope it helps you complete your ideas :)

@merwok yeah forgot to say that.
If you're not in the discord, join now!

P#146514 2024-04-13 02:58 ( Edited 2024-04-13 02:58)

[Please log in to post a comment]