Pyxel File Format

Is there a documentation of .pyxel file format as I would like to create a custom tool to handle my level designs with pyxel edit and then use that tool to add additional info to have it work in my game.

Comments

  • CandyFaceCandyFace Posts: 619
    edited January 2017
    The .pyxel format is just a container. You should be able to rename the .pyxel file to .zip and extract it's content. The extracted folder contain your layers as png (if you have any) and a .json with all the information you need.

    Using a project of my own as an example, your json could look like this
    {
      "palette": {
        "colors": {
          "0": "ff000000",
          "1": "ff222034",
          "2": "ff45283c",
          "3": "ff663931",
          "4": "ff8f563b",
          "5": "ffdf7126",
          "6": "ffd9a066",
          "7": "ffeec39a",
          "8": "fffbf236",
          "9": "ff99e550",
          "10": "ff6abe30",
          "11": "ff37946e",
          "12": "ff4b692f",
          "13": "ff524b24",
          "14": "ff323c39",
          "15": "ff3f3f74",
          "16": "ff306082",
          "17": "ff5b6ee1",
          "18": "ff639bff",
          "19": "ff5fcde4",
          "20": "ffcbdbfc",
          "21": "ffffffff",
          "22": "ff9badb7",
          "23": "ff847e87",
          "24": "ff696a6a",
          "25": "ff595652",
          "26": "ff76428a",
          "27": "ffac3232",
          "28": "ffd95763",
          "29": "ffd77bba",
          "30": "ff8f974a",
          "31": "ff8a6f30"
        },
        "width": 8,
        "numColors": 32,
        "height": 6
      },
      "settings": {
        "ExportImagePanel_prefFormat": "0",
        "ExportImagePanel_prefPath": "/Users/CandyFace/Desktop",
        "ExportImagePanel_prefOverwrite": "false",
        "ExportImagePanel_prefFileName": "Bubblebobble2",
        "ExportImagePanel_prefTranspMatteColor": "4278190080",
        "ExportImagePanel_prefScaling": "3",
        "ExportImagePanel_prefSeparateFiles": "false"
      },
      "version": "0.3.109",
      "canvas": {
        "tileWidth": 100,
        "tileHeight": 100,
        "numLayers": 5,
        "layers": {
          "0": {
            "name": "Layer 4",
            "alpha": 255,
            "tileRefs": {},
            "blendMode": "normal",
            "hidden": false
          },
          "1": {
            "name": "Layer 3",
            "alpha": 115,
            "tileRefs": {},
            "blendMode": "normal",
            "hidden": false
          },
          "2": {
            "name": "Layer 2",
            "alpha": 255,
            "tileRefs": {},
            "blendMode": "normal",
            "hidden": false
          },
          "3": {
            "name": "Layer 2",
            "alpha": 255,
            "tileRefs": {},
            "blendMode": "multiply",
            "hidden": false
          },
          "4": {
            "name": "Layer 1",
            "alpha": 255,
            "tileRefs": {},
            "blendMode": "normal",
            "hidden": false
          }
        },
        "width": 100,
        "height": 100
      },
      "animations": {},
      "tileset": {
        "numTiles": 1,
        "tileHeight": 100,
        "tilesWide": 8,
        "fixedWidth": true,
        "tileWidth": 100
      }
    }
  • Thank you this helped alot (^-^)
    Back to coding :smile: 
Sign In or Register to comment.