diff --git a/docs/architecture/stage-viewer.md b/docs/architecture/stage-viewer.md index a15323cca..aac205b52 100644 --- a/docs/architecture/stage-viewer.md +++ b/docs/architecture/stage-viewer.md @@ -2,90 +2,46 @@ ## Module Purpose -The StageViewer module is designed to show the sprite and stage status of different spx project and dragging the sprite. +The StageViewer module is designed to show the sprite and stage status of different spx project and operate the sprite. -Through the StageViewer module, users can configure the project's sprite, backdrop, stage size, and so on, without caring about the actual rendering logic. +Through the StageViewer module, users can configure the project's sprite, backdrop, stage size, zorder and soon, without caring about the actual rendering logic. ## Module Scope -This module passes in the id of the project, the width and height of the container, the actual stage size, the sprite list, the backdrop, and the list of sprite names that currently need to be displayed on the stage. -When the user drags the sprite, which sends the sprite drag completion event, allowing the user to get the sprite where the drag occurred and the new location in spx. +This module passes the spx project, the width and height of the container,and the list of sprite names that currently need to be selected on the stage. +When the user select new sprite, which sends the onSelectedSpriteChange event, allowing the user to get the selected sprite in the component. ### Inputs | Parameter | Required | Type | Description | | --------- | -------- | ------- | ------------------------------------------------------------ | -| `id` | Yes | `string` | Id of the project | +| `project` | Yes | `Project` | Instance of spx project | | `height` | No | `string` | Container height of stage viewer | | `width` | No | `string` | Container width of stage viewer | -| `mapConfig` | No | `MapConfig` | Actual stage size. If there is no mapConfig, the stage size is calculated according to the backdrop image. | -| `sprites` | Yes | `StageSprite[]` | sprites in project | -| `currentSpriteNames` | Yes | `string[]` | The sprites that need to be displayed on the stage | -| `backdrop` | No | `StageBackdrop` | backdrop in project | +| `selectedSpriteNames` | Yes | `string[]` | Sprites's name that selected on the stage | -### Outputs +### Events | Event Name | Event Data Type | Description | | --------- | -------- | ------- | -| `onSpritesDragEnd` | `SpriteDragEndEvent` | The sprites dragend event| +| `onSelectedSpriteChange` | `{ names: string[] }` | The selected sprite name change| ## Base Usage -In the following example, we pass the backdrop / sprite list and other information obtained from the project store into the stage viewer, and you can see that the sprite and backdrop in the project and the corresponding stage size are rendered in stage viewer. After the sprite has been dragged, you can get the wizard and its information from the onSpritesDragEnd event. +In the following example, we pass the project into the stage viewer, and you can see that the sprite and backdrop in the project and the corresponding stage size are rendered in stage viewer. ```vue ``` \ No newline at end of file