![]() ![]() stat(55) is the number of music patterns played since the most recent call to music().stat(54) is the music pattern ID currently being played, as a result of the most recent call to music().stat(50) through stat(53) return the note number (0 through 31) of the sound effect currently playing on the four channels, respectively.If no sound is playing on the channel, stat() returns -1.stat(46) through stat(49) return the index of the sound effect currently playing on the four channels, respectively.These are the newer versions (0.2.4+) of stat(16) through stat(26), which return the same data with less precision. Stat(46) through stat(56) return audio status. This notice will come up the first time a relevant stat() is read this knowledge can be used to make sure the notice will not obscure something important at a bad time. This is so the user will not be confused if they cannot control the game. If PICO-8 is running in a context where mouse and keyboard cannot be safely relied on (for instance, on the BBS), it will display a notice that devkit mode has been enabled. It's not forbidden to write games that use this mode, but games that do may find a limited audience. For that reason, this is referred to as "devkit mode", intended for debugging and tools. It may be running on a machine without a keyboard or mouse connected, such as a game cabinet with only game controllers, or even a small system-on-a-chip implementation with integrated controls. Other modifier keys are invisible to PICO-8 programs.Ĭonceptually, PICO-8 is a small game console, similar to an NES or GameBoy. For instance, if the player presses Shift+ H, a double-wide heart character will be returned. Instead, it changes the character that is returned from stat(31). The Shift key is not reported separately. Only seen when the user is exiting the pause menu or halting execution. If either is detected, poke(0x5f30,1) can be used to temporarily suppress this action. Some special keys can be detected using these standard Lua escape sequences:īy default, Enter and P bring up the pause menu. Here's a helpful example function allowing you to dynamically set the appropriate mouse/keyboard flags for your Pico-8 project.įunction _update () while stat ( 30 ) do handle_keypress ( stat ( 31 )) end end stat(39) -> relative y movement in host desktop pixels.stat(38) -> relative x movement in host desktop pixels.The next two stat results will only return if bit 0x4 has been set in the flags stat(37) -> number ranging from 0-4 seeming to represent the mouse acceleration delta.stat(36) -> number representing a mouse wheel event.The value returned is in pixels: swiping left returns a positive value, swiping right returns a negative value.stat(35) -> number representing a horizontal mouse wheel or two-finger-swipe event. ![]() This will cause problems if you try to call ord(stat(31)) directly, because ord takes 2 arguments
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |