|
| 1 | +--- |
| 2 | +title: Understanding the Code Editor |
| 3 | +sidebar_position: 4 |
| 4 | +--- |
| 5 | + |
| 6 | +# Understanding the Code Editor |
| 7 | + |
| 8 | +The code editor has lots of individual parts that can be named, seen below: |
| 9 | +<img src="/img/docimages/studio-diagram.png" alt="Diagram of the Studio"></img> |
| 10 | + |
| 11 | +## The Toolbox |
| 12 | +The Toolbox is the menu on the left that allows you to place individual blocks onto the Workspace in the center. |
| 13 | +<img src="/img/docimages/toolbox.png" alt="Image of the toolbox" height="640"></img> |
| 14 | + |
| 15 | +Click and drag a block from the Toolbox, then release the mouse on the Workspace to place a block there. |
| 16 | + |
| 17 | +### Categories |
| 18 | +Categories are individual sections of the toolbox that contain groups of blocks. |
| 19 | +<img src="/img/docimages/categories.png" alt="Categories in the toolbox" height="320"></img> |
| 20 | + |
| 21 | +Each category has blocks related to the name of the category: |
| 22 | +- **Motion:** Blocks related to moving & rotating the Sprite |
| 23 | +- **Looks:** Blocks related to the visual look & style of the Sprite or parts of it |
| 24 | +- **Sound:** Blocks related to playing or modifying sounds |
| 25 | +- **Events:** Blocks that run when certain things happen in the project, or run other events |
| 26 | +- **Control:** Logical blocks that allow you to control how a block stack runs or ends |
| 27 | +- **Sensing:** Blocks related to sensing things on the screen, things about sprites, or sensing devices on the computer |
| 28 | +- **Operators:** Blocks related to mathematical operations, modifying text, mechanical operations, etc |
| 29 | + |
| 30 | +We'll return to Variables, Lists, and My Blocks later. |
| 31 | + |
| 32 | +### Extensions |
| 33 | +Extensions are various new categories you can import in your project if your project needs them. |
| 34 | +<img src="/img/docimages/extension-list.png" alt="Extension list in PenguinMod Studio"></img> |
| 35 | + |
| 36 | +Most simple projects will not require the use of any extensions, but extensions allow for additional functionality in your projects. |
| 37 | + |
| 38 | +You can access this menu by clicking the button with the blocks and a plus at the bottom of the toolbox. |
| 39 | +<img src="/img/docimages/extensions-list-button.png" alt="Extension list button in PenguinMod Studio"></img> |
| 40 | + |
| 41 | +Clicking the category filters on the left will allow you to filter out extensions that you aren't looking for. |
| 42 | +<img src="/img/docimages/extension-list-filters.png" alt="Extension list filters in PenguinMod Studio"></img> |
| 43 | + |
| 44 | +### Monitors |
| 45 | +Click the checkbox next to certain blocks in the toolbox to show a monitor for it. |
| 46 | +<img src="/img/docimages/monitorsexample.png" alt="Monitors in the toolbox"></img> |
| 47 | + |
| 48 | +A monitor will appear on the stage, which shows the value of the block that has it's monitor enabled. |
| 49 | +<img src="/img/docimages/monitorsexample2.png" alt="Monitors in the stage"></img> |
| 50 | + |
| 51 | +You can right-click on a monitor to change it's look or hide the monitor again. |
| 52 | +<img src="/img/docimages/monitorsexampleoption.png" alt="Monitors in the stage"></img> |
| 53 | + |
| 54 | +Dragging a monitor will also move it around on the stage. |
| 55 | + |
| 56 | +## The Workspace |
| 57 | +The workspace is where you will place blocks in your project to make things happen in the project. |
| 58 | +<img src="/img/docimages/workspace.png" alt="Image of the workspace" height="320"></img> |
| 59 | + |
| 60 | +Drag a block from the Toolbox onto the Workspace to add blocks. |
| 61 | + |
| 62 | +You can drag the block around the Workspace to move it, or drag it back onto the Toolbox to delete it. |
| 63 | + |
| 64 | +Connecting blocks on the top or bottom of another block will create Block Stacks, and spots to place blocks inside of other blocks can be known as Inputs, or Arguments. |
| 65 | + |
| 66 | +**Note: Block Stacks are commonly referred to as Scripts.** |
| 67 | + |
| 68 | +### Shortcuts |
| 69 | +View the list of editor shortcuts [here.](/shortcuts#editor) |
| 70 | + |
| 71 | +### Right-click menu |
| 72 | +Right-clicking on an empty part of the workspace will open this menu: |
| 73 | +<img src="/img/docimages/contextmenu.png" alt="Right-click menu on the workspace"></img> |
| 74 | + |
| 75 | +You might see different options if you have other blocks on the workspace, custom extensions, or addons. |
| 76 | + |
| 77 | +Right-clicking on a block will show different menus based on what the block is, and what addons you have enabled. |
| 78 | +<img src="/img/docimages/right-click-block.png" alt="Right click block"></img> |
| 79 | + |
| 80 | +Right-clicking certain blocks with the **Block switching** Editor Addon (enabled by default) will show options to switch it with another block: |
| 81 | +<img src="/img/docimages/right-click-switch.png" alt="Right click switch"></img> |
| 82 | + |
| 83 | +### Comments |
| 84 | +Adding comments on the Workspace or other blocks will create a small note where you can type any information you want. |
| 85 | +<img src="/img/docimages/comment.png" alt="Workspace comment"></img> |
| 86 | + |
| 87 | +- Clicking the arrow on the top of a comment will minimize the comment |
| 88 | +- Clicking the X icon on the top of a comment will delete the comment |
| 89 | +- Dragging the dashed lines at the bottom right of a comment will resize the comment |
| 90 | +- Dragging the top bar of a comment will move the comment around on the workspace |
| 91 | + |
| 92 | +## The Stage |
| 93 | +The stage is the area where sprites and backgrounds will appear in the project. |
| 94 | +<img src="/img/docimages/stage.png" alt="Editor stage"></img> |
| 95 | + |
| 96 | +Drag a sprite on the screen to move it somewhere else. (Enable the **Non-draggable sprites in editor** addon to change this behavior.) |
| 97 | + |
| 98 | +- Clicking the Blue Flag acts like starting the project, resetting Sprite effects, |
| 99 | + resetting clones and activating <img src="/img/docimages/blocktype_event.png" alt="when flag clicked" height="48"></img> event blocks |
| 100 | +- Clicking the Pause icon will pause all blocks and sounds in the project |
| 101 | +- Clicking the Stop icon will stop the project, resetting Sprite effects, |
| 102 | + deleting clones and activating <img src="/img/docimages/stop_event.png" alt="when stop clicked" height="48"></img> event blocks |
| 103 | + |
| 104 | +You can click the outwards-pointing arrows button to enter a fullscreen mode, |
| 105 | +or click the buttons next to it to scale down the stage in the editor if it takes up too much space. |
| 106 | + |
| 107 | +### Selecting the stage sprite |
| 108 | +Next to the Sprite list, the Stage is selectable on the right side. |
| 109 | + |
| 110 | +Selecting the stage will disable certain categories if the stage cannot use any blocks from them: |
| 111 | +<img src="/img/docimages/stage-disabled-category.png" alt="Stage disabled category"></img> |
| 112 | + |
| 113 | +The Stage also replaces **Costumes** with **Backdrops**, acting as a background to the project. |
| 114 | + |
| 115 | +## The Sprite List |
| 116 | +The Sprite List is a grid list of the sprites inside the project. |
| 117 | +<img src="/img/docimages/sprite-list.png" alt="Sprite List"></img> |
| 118 | + |
| 119 | +Hovering over the blue button in the bottom right will allow you to import or draw a sprite. |
| 120 | + |
| 121 | +### What actually is a Sprite? |
| 122 | +A Sprite is an object that has Costumes to determine how it looks, has Block Code to determine what it does, and has Sounds to determine the noises it can make. |
| 123 | +<img src="/img/docimages/sprite-diagram.png" alt="Sprite diagram"></img> |
| 124 | + |
| 125 | +Block code can switch to different sprite costumes, move the sprite around, resize the sprite, play sprite sounds, etc. |
| 126 | + |
| 127 | +## The Backpack |
| 128 | +The Backpack is a menu at the bottom of the editor where you can store Sprites, Costumes, Sounds, or even Block stacks. |
| 129 | +<img src="/img/docimages/backpack.png" alt="Backpack"></img> |
| 130 | + |
| 131 | +Content inside the backpack is accessible for other projects you may create. |
| 132 | + |
| 133 | +:::note |
| 134 | +Backpacks in PenguinMod save to your computer. If you switch browsers or clear your browsing data, you may lose your backpack. |
| 135 | +::: |
| 136 | + |
| 137 | +:::warning |
| 138 | +As of now, including a Custom Extension in Code or Sprites inside your backpack may cause unexpected behavior. |
| 139 | +Try loading extensions inside the code or sprites before trying to import the content from your backpack. |
| 140 | +::: |
| 141 | + |
| 142 | +## Restore Points |
| 143 | +Restore Points are an auto-saving feature in PenguinMod in the case you forgot to save your project. |
| 144 | +:::danger |
| 145 | +Do not rely on Restore Points for saving as they may be randomly deleted by your computer or browser. |
| 146 | +If you switch browsers or clear your browsing data, you may lose any restore points you had. |
| 147 | + |
| 148 | +You can save your projects to a file by clicking "Save to your computer" in the top right when you make changes. |
| 149 | +::: |
| 150 | + |
| 151 | +<img src="/img/docimages/restore-points.png" alt="Restore Points menu"></img> |
| 152 | + |
| 153 | +You can change the auto-save period between when Restore Points are created in this menu, or delete all existing Restore Points. |
| 154 | + |
| 155 | +Clicking on a Restore Point will confirm if you'd like to load the project from that Restore Point. |
| 156 | + |
| 157 | +It is recommended to configure this auto-save period to your liking depending on how long you spend in the editor, how often you save, and how often you load other projects. |
0 commit comments