Skip to content

Commit cd88750

Browse files
authored
Asset pack doc page (#11129)
* asset pack setting examples * fill in the page * add doc to extensions main page * redundant 'have' * remove 'data chunks' * add a section to the 'share' page * change 'target' to 'editor' * spelling * include the youtube llink
1 parent 42acc13 commit cd88750

6 files changed

Lines changed: 55 additions & 0 deletions

File tree

common-docs/share.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,16 @@ By default, all shared projects in MakeCode can be copied and edited. There is n
5656

5757
![Edit shared project button](/static/share/edit-shared-project.png)
5858

59+
## Asset Packs #asset-packs
60+
61+
Certain editors (such as [MakeCode Arcade](https://arcade.makecode.com)) can include resource files inside of projects. The resources, or _assets_, might contain byte respresentations of images, animations, sounds, tilemaps, etc. An **Asset Pack** is a resource only project where just the assets are shared and no code is loaded from the shared project.
62+
63+
If this feature is supported by your editor, you can set a project as an asset pack by going to the **Settings** (⚙️) menu and selecting 'Project Settings'. Enable the 'Import as asset pack' setting. Watch this video to see how it's done:
64+
65+
https://youtu.be/CjLYl5KJiSk
66+
67+
See the [Asset Packs](https://makecode.com/extensions/asset-packs) page to learn more.
68+
5969
## Report Abuse
6070

6171
All MakeCode shared projects pass through Microsoft standard scanning for security and safety compliance. In addition, the "Report Abuse" option is available on any shared project if you deem the contents of the project not appropriate (contains unsafe content or includes personally identifiable information). For these types of projects, the MakeCode Team will remove the project from our databases.

docs/extensions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ In this scenario, PXT dynamically loads the neopixel extensions directly from Gi
2626
* [Extension approval](/extensions/approval)
2727
* [GitHub Extension Authoring](/extensions/github-authoring)
2828
* [Adding docs to GitHub Extensions](/extensions/github-docs)
29+
* [Asset only (asset pack) extensions](/extensions/asset-packs)
2930

3031
## [Editor extensions](/extensions/extensions)
3132

docs/extensions/asset-packs.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Asset packs
2+
3+
Certain editors (such as [MakeCode Arcade](https://arcade.makecode.com)) can include resource files inside of projects. The resources, or _assets_, might contain byte respresentations of images, animations, sounds, tilemaps, etc.
4+
5+
An extension containing assets may use them to support the code provided in the extension (custom buttons, animations, etc.). However, you can mark an extension to import only its assets and not include any of the code exported in the extension. This is useful as a way to package reusable assets and publish them for others to use in their projects.
6+
7+
## Assets in the extension
8+
9+
Assets are included as part of the `files[]` list in the `pxt.json` file. As an example, here are some shark image assets in a MakeCode Arcade extension.
10+
11+
![Shark image assets](/static/extensions/shark-image-assets.png)
12+
13+
These images are contained and loaded using the `assets.json` and `images.*` files.
14+
15+
```json
16+
{
17+
"name": "hungry-sharks",
18+
"description": "",
19+
"dependencies": {
20+
"device": "*"
21+
},
22+
"files": [
23+
"main.blocks",
24+
"main.ts",
25+
"README.md",
26+
"assets.json",
27+
"images.g.jres",
28+
"images.g.ts"
29+
],
30+
"preferredEditor": "tsprj"
31+
}
32+
```
33+
34+
## Commit settings
35+
36+
When committing project changes to GitHub, if assets are present, an **Import as asset pack** option appears in the 'Extension zone' of the commit operation window.
37+
38+
![Import assets not set](/static/extensions/asset-pack-unset.png)
39+
40+
Turning on this option will cause the editor to only load the assets in the extension and ignore any code.
41+
42+
If a project already has the import option, `pxt.json` will contain the setting `"assetPack": true` and the settings in the commit operation window will show the **Import as asset pack** option as set.
43+
44+
![Import assets set](/static/extensions/asset-pack-set.png)
96.5 KB
Loading
50.1 KB
Loading
50.7 KB
Loading

0 commit comments

Comments
 (0)