Greetings my fellow MakeCode Arcade beings!
I figured out how to use a custom color palette and export the image to use with MakeCode Arcade using the official PXT Editor Asset Tool.
Steps to get Everything Ready
- Create a .txt with your color palette. NOTE: Do NOT add the transparency 000000 to the file or it won’t work!
.txt File Example
- Open up your game in MakeCode Arcade.
- Navigate to the JavaScript tab at the top.
- Expand the Explorer menu on the left.
- Go to pxt.json and click on it.
- Click “Edit Settings As text.”
- Scroll down until you see the line “preferredEditor”: “tsprj” and add a comma after the last quotation mark for “tsprj”.
8.Insert the code belo after that line, changing the hex codes to match your color palette.
NOTE: Make sure that the order is EXACTLY the same as it is in the .txt file, or it won’t work correctly!
Palette Code Example
"palette": [
"#000000",
"#1a1c2c",
"#5d275d",
"#b13e53",
"#ef7d57",
"#ffcd75",
"#a7f070",
"#38b764",
"#29366f",
"#3b5dc9",
"#41a6f6",
"#73eff7",
"#f4f4f4",
"#94b0c2",
"#566c86",
"#333c57"
]
- Check that the color palette is correct in the Assets tab.
Creating the Assets
- Go to the PXT Editor Extension Tool.
- Drag the .txt file you create earlier onto the webpage.
- Drag your .png file onto the webpage.
- Click on the dropdown box under Palette, and select the color palette you uploaded.
- Click in the box on to the right of your asset.
- Either select all of it manually, or press CTRL + A at the same time to select all of the text.
NOTE: The Copy button does not work! - Navigate to the JavaScript tab and make sure that main.ts is selected.
- At the top, hit Enter a few times, then paste the code from the website.
- Let your project save, then go to the Blocks tab.
- You should see the asset in the on start block.
- Rejoice.
I hope my tutorial was helpful! If you have any questions, please feel free to ask!
(I didn’t know where to put this. Mods, feel free to move it.)