mirror of
https://github.com/galacean/engine.git
synced 2026-06-01 00:05:56 +08:00
doc: remove unused slot
This commit is contained in:
@@ -107,7 +107,7 @@ The manual add method is similar to the quick add method, but you need to manual
|
||||
|
||||
添加了 SpineAnimationRenderer 组件后,同样需要指定组件的 Resource,也就是 SpineAnimationRenderer 组件要渲染的 SpineSkeletonData 资产。
|
||||
|
||||
### SpineAnimationRenderer 组件配置 {/*examples*/}
|
||||
### SpineAnimationRenderer 组件配置
|
||||
以上三种添加 Spine 动画的方法实际上本质其实是相同的,都是通过给实体 `添加 SpineAnimationRenderer 组件` ,来让 Spine 动画添加至场景中的。
|
||||
|
||||
SpineAnimationRenderer 组件的配置如下:
|
||||
@@ -123,7 +123,7 @@ SpineAnimationRenderer 组件的配置如下:
|
||||
- Scale:默认的缩放系数
|
||||
- Priority:渲染优先级
|
||||
|
||||
## 4. 项目导出 {/*examples*/}
|
||||
## 4. 项目导出
|
||||
最终,完成场景编辑器后,可以参考[项目导出](/en/docs/assets/build/)流程,导出编辑器项目。
|
||||
|
||||
</br></br></br></br>
|
||||
|
||||
@@ -102,9 +102,9 @@ Click on the `Sprite Atlas` asset, adjust the `Max Texture Width` and `Max Textu
|
||||
|
||||
The left side of the preview image shows the size information of the exported image, and the right side shows the atlas utilization information (representing the percentage of the total area of all scattered images occupying the final large image). You can adjust the packing settings based on this value to achieve better results.
|
||||
|
||||
## Script Usage {/*examples*/}
|
||||
## Script Usage
|
||||
|
||||
### Atlas Generation {/*examples*/}
|
||||
### Atlas Generation
|
||||
|
||||
Galacean provides a command-line tool for sprite atlas generation. Developers can generate an atlas by following these steps:
|
||||
|
||||
@@ -138,7 +138,7 @@ Here, `inputPath` represents the path of the folder to be packed, and `outputNam
|
||||
|
||||
For more details, refer to [Atlas Packing Tool](https://github.com/galacean/tools/blob/main/packages/atlas/README.md).
|
||||
|
||||
### Usage {/*examples*/}
|
||||
### Usage
|
||||
|
||||
1. Upload the atlas image and atlas file to the same directory on the CDN. For example, the addresses of the file and image should be `https://*cdnDir*/*atlasName*.atlas` and `https://*cdnDir*/*atlasName*.png`, respectively.
|
||||
|
||||
@@ -160,7 +160,7 @@ engine.resourceManager
|
||||
});
|
||||
```
|
||||
|
||||
## Notes {/*examples*/}
|
||||
## Notes
|
||||
|
||||
1. Please pack sprites with connected drawing sequences into the same atlas to significantly improve performance (reduce the number of draw calls);
|
||||
2. When cleaning up the sprite atlas, ensure that all sprites in the atlas are no longer in use;
|
||||
|
||||
@@ -137,7 +137,7 @@ const texture = new Texture2D(engine, width, height);
|
||||
texture.setImageSource(img, 0, true); // The 3rd parameter
|
||||
```
|
||||
|
||||
### premultiplyAlpha {/*examples*/}
|
||||
### premultiplyAlpha
|
||||
|
||||
premultiplyAlpha is used to control whether the texture pre-multiplies the alpha (transparency) channel. **The engine and editor have it turned off by default**. If you need to change the default behavior of premultiplyAlpha, you can do so through the [setImageSource](/apis/core/#Texture2D-setImageSource) method:
|
||||
|
||||
@@ -146,7 +146,7 @@ const texture = new Texture2D(engine, width, height);
|
||||
texture.setImageSource(img, 0, undefined, true); // The 4th parameter
|
||||
```
|
||||
|
||||
### format {/*examples*/}
|
||||
### format
|
||||
|
||||
The engine uses `TextureFormat.R8G8B8A8` as the default texture format, meaning that the red, green, blue, and alpha channels each use 1 byte, allowing each channel to store color values ranging from 0 to 255. The engine supports configuring different texture formats, which can be referenced in [TextureFormat](/apis/core/#TextureFormat). For example, if we do not need to use the alpha channel, i.e., the A channel, we can use `TextureFormat.R8G8B8`:
|
||||
|
||||
|
||||
@@ -241,7 +241,7 @@ For example, to add documentation for the animation system joint:
|
||||
|
||||
对于文档国际化而言,则同步在 `/docs/en` 文件夹中做上述操作
|
||||
|
||||
## 新增博客 {/*examples*/}
|
||||
## 新增博客
|
||||
新增博客与新增文档的过程类似,只是 frontMatter 多了一些支持的字段。
|
||||
|
||||
1. 新增博客文档 `blog/new_blog.mdx`
|
||||
@@ -254,10 +254,10 @@ For example, to add documentation for the animation system joint:
|
||||
6. **searchable** 需要配置为 `searchable: false` 从而避免被内置的搜索引擎搜索到
|
||||
7. **summary** 博客的摘要,会显示在博客列表页中
|
||||
|
||||
## 新增 Changelog {/*examples*/}
|
||||
## 新增 Changelog
|
||||
和新增博客的过程一样,只不过文件位于 `/changelog` 中。
|
||||
|
||||
## 新增示例 {/*examples*/}
|
||||
## 新增示例
|
||||
除了以往的单文件示例开发外,我们许你将一个大的示例进行拆分。比如将资产文件列表拆分成一个 `json`,或者将 `dat-gui` 的配置拆分到 `gui-config.ts` 中等等。
|
||||
|
||||
要实现文件拆分,你只需要在 `examples` 文件中新建示例文件夹,确保文件夹中包含一个 `index.ts` 即可。在示例页面生成时,会自动检测代码中所依赖的其他文件,并注入到工作区中。
|
||||
|
||||
@@ -7,7 +7,7 @@ label: Interact
|
||||
|
||||
Galacean's touch is based on [Pointer](https://www.w3.org/TR/pointerevents3/), which smooths out the differences between [Mouse](https://developer.mozilla.org/zh-CN/docs/Web/API/MouseEvent) and [Touch](https://developer.mozilla.org/zh-CN/docs/Web/API/TouchEvent), making touch unified in both concept and interface.
|
||||
|
||||
## Pointer {/*examples*/}
|
||||
## Pointer
|
||||
|
||||
In Galacean, whether it's a mouse on a PC, a stylus or a finger on a mobile device, when it performs the corresponding behavior within the touch range (**Down**, **Move**, etc.), it will be instantiated as a [Pointer](/apis/core/#Pointer). You can get all the currently active touch points in the [InputManager](/apis/core/#InputManager).
|
||||
|
||||
@@ -15,7 +15,7 @@ In Galacean, whether it's a mouse on a PC, a stylus or a finger on a mobile devi
|
||||
|
||||
> It should be noted that each touch point is independent of each other, they respond to the corresponding events and callback the corresponding hook functions.
|
||||
|
||||
### Lifecycle {/*examples*/}
|
||||
### Lifecycle
|
||||
|
||||
Each touch point will start its life in **PointerDown** or **PointerMove**, and leave the stage in **PointerLeave** or **PointerCancel**. In Galacean, you can get the real-time status of this touch point through `Pointer.phase`.
|
||||
|
||||
@@ -38,7 +38,7 @@ timeline
|
||||
|
||||
<playground src="input-log.ts"></playground>
|
||||
|
||||
### Touch Buttons {/*examples*/}
|
||||
### Touch Buttons
|
||||
|
||||
Referring to the [W3C standard](https://www.w3.org/TR/uievents/#dom-mouseevent-button) and [Microsoft related documentation](https://learn.microsoft.com/en-us/dotnet/api/system.windows.input.mousebutton?view=windowsdesktop-6.0), Galacean defines touch buttons as follows:
|
||||
|
||||
@@ -58,7 +58,7 @@ Combining touch buttons can easily detect the behavior of touch points triggered
|
||||
|
||||
<playground src="input-pointerButton.ts"></playground>
|
||||
|
||||
### Touch Callbacks {/*examples*/}
|
||||
### Touch Callbacks
|
||||
|
||||
You only need to add touch callbacks to an Entity with a Collider component to enable interaction with rendered objects. Touch callbacks are integrated into the engine's [script lifecycle](/en/docs/script/class/#脚本生命周期), allowing users to easily add the following events. The hook functions will carry the Pointer instance that triggered the callback.
|
||||
|
||||
@@ -81,7 +81,7 @@ Example:
|
||||
|
||||
<playground src="input-pointer.ts"></playground>
|
||||
|
||||
### Raycasting {/*examples*/}
|
||||
### Raycasting
|
||||
|
||||
Touch callbacks are implemented based on raycasting. Customizing raycasting is also very simple, just follow these steps.
|
||||
|
||||
@@ -118,7 +118,7 @@ Design ideas can be referenced at: https://github.com/galacean/engine/wiki/Input
|
||||
|
||||
## QA
|
||||
|
||||
### Touch works fine on PC but behaves abnormally on mobile devices {/*examples*/}
|
||||
### Touch works fine on PC but behaves abnormally on mobile devices
|
||||
|
||||
On mobile devices, touch interactions trigger the default behavior of HTML elements. Once the default behavior is triggered, the touch interaction is removed from the element (PointerCancel). This can be resolved by setting the `touchAction` of the listening source. If the listening source is the default canvas:
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ label: Script
|
||||
|
||||
Projects developed with Galacean Engine often need to communicate with the external environment, such as sending runtime information of the project to the outside or obtaining certain configuration information from the external environment. At this time, you can use the event system of Galacean Engine to achieve such functions.
|
||||
|
||||
## Adding Events {/*examples*/}
|
||||
## Adding Events
|
||||
|
||||
Galacean Engine provides [EventDispatcher](/apis/core/#EventDispatcher) as the event class, and [Engine](/apis/core/#Engine) inherits from [EventDispatcher](/apis/core/#EventDispatcher). Therefore, we directly use `engine` in the code as the medium for internal and external communication.
|
||||
|
||||
@@ -43,7 +43,7 @@ class MyScript extends Script {
|
||||
|
||||
After saving the code, we can see the corresponding events in the event panel.
|
||||
|
||||
## Triggering Events {/*examples*/}
|
||||
## Triggering Events
|
||||
|
||||
Calling the `engine.dispatch` method can dispatch events. Dispatching events will execute the corresponding callback function using the parameters configured in `dispatch`.
|
||||
|
||||
@@ -53,7 +53,7 @@ this.engine.dispatch("Trigger", { eventData: "mydata" });
|
||||
|
||||
You can trigger events in any lifecycle of the script. Of course, you can also use the event panel to trigger events or configure the parameters carried when triggering events.
|
||||
|
||||
## Removing Events {/*examples*/}
|
||||
## Removing Events
|
||||
|
||||
You can remove related events using `this.engine.off`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user