m (→‎top: template removal and cleanup)
(Automated edit: Added {{External Programs}})
 
(42 intermediate revisions by 22 users not shown)
Line 1: Line 1:
 +
{{External Programs}}
 
{{April Fools}}
 
{{April Fools}}
[[File:Backpack.png|thumb|350px|A user's '''backpack'''.]]
+
[[File:Backpack (3.0).png|thumb|350px|A user's backpack.]]
The '''backpack''' is a feature of the [[Scratch 2.0]] [[Scratch#Environment|project editor]] that allows [[Scratcher|users]] to drag and drop [[costume]]s, [[sprite]]s, [[sound]]s, and [[script]]s from other [[project]]s into it and then drag and drop them easily into their project. This can be used to create multiple copies of a script or add a script to a different project.
+
The '''backpack''' is a feature of the [[Scratch 3.0]] [[Scratch User Interface|project editor]] that allows [[Scratcher|users]] to move scripts, costumes, and sounds between different projects. One can drag and drop [[costume]]s, [[sprite]]s, [[sound]]s, and [[script]]s from other [[project]]s into it and then drag and drop them easily into their project. This can be used to create multiple copies of a script or add a script to a different project.
Eg: You can drag your [[platformer]] engine into your backpack to use in another platformer game you make without having to re-make the whole thing. The backpack is collapsible, so, if the user is not using it at the moment, it is not taking up space.
 
  
This feature is different from previous versions, because even if a project is [[Project Downloading|downloaded]], the files used within it are not easily accessible for use in another project, and the user must [[Exporting and Importing#Exporting|export]] the media first.  
+
For example, one can drag their [[platformer]] engine into their backpack to use in another platformer game they make, without the need to recreate the whole script. The backpack is collapsible, so, if the user is not using it, it does not waste space.
  
The code contents in a user's backpack (in the form of [[JSON]]) can be seen in <pre>https://scratch.mit.edu/internalapi/backpack/USERNAME-HERE/get/</pre>
+
The backpack is only available for the online editor. If one is programming in the [[Offline Editor]], they must first [[export]] the material in the project to use in another project or online.  
  
However, you can only access your own backpack, and to prove your identity you must be logged in. If you try to access somebody else's backpack, you will see a [[403]] error.
+
One can only access their own backpack, and therefore one must be logged in to access a user's backpack. If a user attempts to access somebody else's backpack, they will see a [[403 Error]].
==Adding Media==
 
To add media to the backpack, open the backpack by clicking on the "Backpack" tag at the bottom of the screen. Then drag a sprite, sound, costume, or script fragment into it. There is no limit as to how much media the backpack can contain. Media can also be clicked and dragged around throughout the backpack for organization. To remove media from the backpack, right-click on the desired item and select "delete".
 
  
===Adding Scripts through the Forums===
+
When Scratch 3.0 was released, the Scratch backpack server changed to https://backpack.scratch.mit.edu.{{cn|date=August 2020}} Users are able to request information from this like the Scratch API. For example, when the Scratch backpack is down, this is visible through the server.
{{Obsolete feature}}
 
{{Note | This feature was only usable with scripts that use blocks included in the current version of Scratch (2.0). If the "Add to Backpack" button did not appear, it was probably because the script contained an undefined (red) block. }}
 
To add scripts to the backpack from the [[Discussion Forums]], one would click the "Add to Backpack" button next to a script. It would ask you what the script should be named, and once you click "Okay," it will be added to your backpack.
 
  
==Using Media==
+
== Adding Media ==
 +
To add media to the backpack, open the backpack by clicking on the "Backpack" tag at the bottom of the screen. Then drag a sprite, sound, costume, or script fragment into it. There is seemingly no limit as to how much media the backpack can contain.{{citation needed|date=April 2018}} Media can also be clicked and dragged around throughout the backpack for organization. To remove media from the backpack, right-click on or tap and hold the desired item and select "delete".
 +
 
 +
One can also set the contents of a user's backpack through a <code>POST</code> request to <pre>https://scratch.mit.edu/internalapi/backpack/USERNAME-HERE/set</pre>
 +
 
 +
The <code>X-CSRFToken</code> must be passed with the CSRF token (which can be found in the <code>scratchcsrftoken</code> cookie); and should pass a JSON payload as the body of the request, containing the desired backpack. The user must be authenticated (i.e. logged in).
 +
 
 +
=== Adding Scripts Through the Forums ===
 +
{{obsolete feature|cat=no}}
 +
{{note|This feature only worked if all the blocks are valid. It would not work if there are any undefined blocks.}}
 +
To add scripts to the backpack from the [[Scratch Discussion Forums]], one could{{when|date=January 2021}} click the "Add to Backpack" button next to a script.<ref>[[topic:207768]]</ref> It asked what the script should be named, and once the user clicked "Okay", it was be added to the backpack. This feature was later removed because it allowed invalid blocks to be added to the backpack.<ref>[[post:2176575]]</ref>
 +
 
 +
== Using Media ==
 
To remove media from the backpack, in the same or another project, one can open the backpack by clicking on the tab, the same way as before. Then, one can click and drag the media out of the backpack and into the project editor. Specific types of media must be dragged into specific areas of the project editor. For example, one cannot drag an image into the [[Sound Editor|sound editor]], as it will simply disappear and cause no function. When dragging media from the backpack, the object is not removed from the backpack but duplicated.
 
To remove media from the backpack, in the same or another project, one can open the backpack by clicking on the tab, the same way as before. Then, one can click and drag the media out of the backpack and into the project editor. Specific types of media must be dragged into specific areas of the project editor. For example, one cannot drag an image into the [[Sound Editor|sound editor]], as it will simply disappear and cause no function. When dragging media from the backpack, the object is not removed from the backpack but duplicated.
  
If an item icon has a question mark on it, it means that the item has failed to be fully be put in the backpack. It does nothing when dragged to the project.
+
If an item icon has a question mark on it, it means that the item has failed to be fully put in the backpack. It does nothing when dragged to the project.
  
==Exporting==
+
== Exporting ==
Some media can still be exported from the backpack. The following media can be exported by right-clicking on its icon and selecting "Save to Local File":
+
Some media can be exported from the backpack. One can export a costume or backdrop by right-clicking on its icon and selecting "Save to Local File".
*Costumes
 
  
==Information==
+
== Information ==
*The backpack shows an icon or image of the media in it, along with some information about it.
+
* The backpack shows an icon or image of the media in it, along with some information about it.
**For a sprite, it has the thumbnail of the sprite as it was dragged into the backpack, along with the name of the sprite.
+
** For a sprite, it has the thumbnail of the sprite as it was dragged into the backpack, along with the name of the sprite.
**For a costume, it has a thumbnail of the costume, along with the name.
+
** For a costume, it has a thumbnail of the costume, along with the name.
**For a sound, it has a sound icon, along with the sound's name.
+
** For a sound, it has a sound icon, along with the sound's name.
**For a script, it has a thumbnail of the script, and the text "Script".
+
** For a script, it has a thumbnail of the script, and the text "Script".
  
==Glitches==
+
== Glitches ==
There has been a glitch which the Scratch Editor ignores some sounds when dragged out of the backpack.<ref>http://scratch.mit.edu/discuss/topic/10666/</ref> The only workarounds are [[Importing and Exporting|exporting]] sounds and then importing the sound in or making a random sprite with the sound, dropping it into the backpack, and duplicating it into a new project.
+
There has been a glitch which the Scratch Editor ignores some sounds when dragged out of the backpack.<ref>[[topic:10666]]</ref> The only workarounds are [[Importing and Exporting|exporting]] sounds and then importing the sound in or making a random sprite with the sound, dropping it into the backpack, and duplicating it into a new project.
  
==References==
+
== See Also ==
 +
* [[How do I put things in my backpack?]]
 +
 
 +
== References ==
 
<references/>
 
<references/>
 +
 
[[Category:Scratch Program]]
 
[[Category:Scratch Program]]
 
[[de:Lager]]
 
[[de:Lager]]
Line 43: Line 53:
 
[[id:Ransel]]
 
[[id:Ransel]]
 
[[ja:バックパック]]
 
[[ja:バックパック]]
 
+
[[ru:Рюкзак]]
== See Also ==
 
*[[How do I put things in my backpack?]]
 

Latest revision as of 11:19, 3 June 2021

SandCastleIcon.png This article has links to websites or programs not trusted by Scratch or hosted by Wikipedia. Remember to stay safe while using the internet, as we cannot guarantee the safety of other websites.


A user's backpack.

The backpack is a feature of the Scratch 3.0 project editor that allows users to move scripts, costumes, and sounds between different projects. One can drag and drop costumes, sprites, sounds, and scripts from other projects into it and then drag and drop them easily into their project. This can be used to create multiple copies of a script or add a script to a different project.

For example, one can drag their platformer engine into their backpack to use in another platformer game they make, without the need to recreate the whole script. The backpack is collapsible, so, if the user is not using it, it does not waste space.

The backpack is only available for the online editor. If one is programming in the Offline Editor, they must first export the material in the project to use in another project or online.

One can only access their own backpack, and therefore one must be logged in to access a user's backpack. If a user attempts to access somebody else's backpack, they will see a 403 Error.

When Scratch 3.0 was released, the Scratch backpack server changed to https://backpack.scratch.mit.edu.[citation needed] Users are able to request information from this like the Scratch API. For example, when the Scratch backpack is down, this is visible through the server.

Adding Media

To add media to the backpack, open the backpack by clicking on the "Backpack" tag at the bottom of the screen. Then drag a sprite, sound, costume, or script fragment into it. There is seemingly no limit as to how much media the backpack can contain.[citation needed] Media can also be clicked and dragged around throughout the backpack for organization. To remove media from the backpack, right-click on or tap and hold the desired item and select "delete".

One can also set the contents of a user's backpack through a POST request to

https://scratch.mit.edu/internalapi/backpack/USERNAME-HERE/set

The X-CSRFToken must be passed with the CSRF token (which can be found in the scratchcsrftoken cookie); and should pass a JSON payload as the body of the request, containing the desired backpack. The user must be authenticated (i.e. logged in).

Adding Scripts Through the Forums

Archive.png This article or section documents something not included in the current version of Scratch (3.0). It is only useful from a historical perspective.
Note Note: This feature only worked if all the blocks are valid. It would not work if there are any undefined blocks.

To add scripts to the backpack from the Scratch Discussion Forums, one could[when?] click the "Add to Backpack" button next to a script.[1] It asked what the script should be named, and once the user clicked "Okay", it was be added to the backpack. This feature was later removed because it allowed invalid blocks to be added to the backpack.[2]

Using Media

To remove media from the backpack, in the same or another project, one can open the backpack by clicking on the tab, the same way as before. Then, one can click and drag the media out of the backpack and into the project editor. Specific types of media must be dragged into specific areas of the project editor. For example, one cannot drag an image into the sound editor, as it will simply disappear and cause no function. When dragging media from the backpack, the object is not removed from the backpack but duplicated.

If an item icon has a question mark on it, it means that the item has failed to be fully put in the backpack. It does nothing when dragged to the project.

Exporting

Some media can be exported from the backpack. One can export a costume or backdrop by right-clicking on its icon and selecting "Save to Local File".

Information

  • The backpack shows an icon or image of the media in it, along with some information about it.
    • For a sprite, it has the thumbnail of the sprite as it was dragged into the backpack, along with the name of the sprite.
    • For a costume, it has a thumbnail of the costume, along with the name.
    • For a sound, it has a sound icon, along with the sound's name.
    • For a script, it has a thumbnail of the script, and the text "Script".

Glitches

There has been a glitch which the Scratch Editor ignores some sounds when dragged out of the backpack.[3] The only workarounds are exporting sounds and then importing the sound in or making a random sprite with the sound, dropping it into the backpack, and duplicating it into a new project.

See Also

References

Cookies help us deliver our services. By using our services, you agree to our use of cookies.