Skip to content

Latest commit

 

History

History
129 lines (93 loc) · 5.21 KB

faq-en.md

File metadata and controls

129 lines (93 loc) · 5.21 KB

Pyxel FAQ

Migrating to a New Version

How to migrate code to version 1.5

To make your code compatible with version 1.5, follow these steps:

  • Rename the caption option in init to title
  • Rename the scale option in init to display_scale
  • Remove the palette option from init (you can modify the palette colors with the colors array after initialization)
  • Remove the fullscreen option from init (you can toggle fullscreen mode using the fullscreen function after initialization)
  • If an undefined key name error occurs, rename the key according to the key definitions
  • Change get and set in the Image and Tilemap classes to pget and pset, respectively
  • Multiply the u, v, w, and h parameters of bltm by 8 (as bltm now operates in pixel units)
  • Update the members and methods of the Sound and Music classes to their new names
I can’t use the pyxeleditor command in version 1.5+.

Starting from version 1.5, Pyxel's tools have been integrated into the pyxel command. To access the resource editor, use the following command: pyxel edit [PYXEL_RESOURCE_FILE].

Learning Pyxel

Where do I start to learn Pyxel?

It is recommended to try Pyxel's example code in the following order: 01, 05, 03, 04, 02.

Are there any books on Pyxel?

The official book is available in Japanese only.

API Specification and Usage

What is the difference between the update and draw functions?

The update function is called every frame, but the draw function may be skipped if the processing time exceeds the allowable limit. This design in Pyxel reduces the impact of rendering load and OS interruptions, enabling smooth animation.

What are the types and usage of Pyxel's MML commands?

The following are the types of commands available for use with the mml method of the Sound class:

  • T(1-900)
    Specifies the tempo. The default is 100.
    Note that there may be discrepancies in the specified tempo because it is converted using the formula Sound.speed = 900/T.
    The tempo applies to the entire sound, and if specified multiple times, the last value will be used.
  • @(0-3)
    Specifies the tone. The default is 0.
  • O(0-4)
    Specifies the octave. The default is 2.
  • >
    Increases the octave by 1.
  • <
    Decreases the octave by 1.
  • Q(1-8)
    Specifies the quantization (length of the sound). At 8, there is no gap between notes; at 4, it is halved. The default is 7.
  • V(0-7)
    Specifies the volume. The default is 7.
  • X(0-7)
    Defines and specifies the volume envelope. This is an advanced command used instead of V.
    For example, specifying X2:345 switches to envelope 2 and changes the volume of each note to something like 34555... The unit of volume change is a sixteenth of a quarter note.
    Specifying X2 switches to envelope 2 and uses the volume envelope set for that number.
  • L(1/2/4/8/16/32)
    Specifies the length of notes and rests. L8 is an eighth note. The default is 4.
  • CDEFGAB
    Plays the note for the specified pitch.
    You can specify a length (1/2/4/8/16/32) after the note, like F16, to temporarily change the note's length.
  • R
    Plays a rest.
    You can specify a length (1/2/4/8/16/32) after the rest, like R8, to temporarily change the rest's length.
  • # or +
    Written after a note, raises the pitch by a semitone.
  • -
    Written after a note, lowers the pitch by a semitone.
  • .
    Dotted note. Written after a note, extends its length by half.
  • ~
    Written after a note, plays it with vibrato.
  • &
    Ties the next note if it has the same pitch, or slurs it if the pitch is different.

Using Pyxel Tools

Can I change the palette colors in Pyxel Editor?

By placing a Pyxel palette file (.pyxpal) in the same directory as the Pyxel resource file (.pyxres), you can match the palette colors used in Pyxel Editor to those in the resource file. For instructions on creating a Pyxel palette file, please refer to the README.

Future Development Plans

What features are planned for future releases?

The following features and improvements are planned:

  • Add a Pyxel app launcher
  • Overhaul of sound functions and MML support
  • Improve usability of Pyxel Editor
  • Add Pyxel tutorials for children

Licensing and Sponsorship

Can I use Pyxel for commercial purposes without the author's permission?

As long as you comply with the MIT License and clearly display the full text of the copyright and license in the source code or license file, you are free to sell or distribute it without the author’s permission. However, since Pyxel is developed by a single individual, it would be appreciated if you could contact the author or consider sponsoring their work if possible.