From fc359c8a7af947bde486a4d1c04dcfb8fd1d1ba7 Mon Sep 17 00:00:00 2001 From: ftershock <53322920+ftershock@users.noreply.github.com> Date: Wed, 6 Nov 2019 18:30:12 +0800 Subject: [PATCH] add tooltip (#5663) * Add tooltip * add tooltip * update spriteatlas * add changeSpriteFrameFromAtlas --- cocos/audio/audio-source-component.ts | 18 +++++-- .../batched-skinning-model-component.ts | 14 ++++-- cocos/core/3d/framework/camera-component.ts | 40 ++++++++++++---- .../framework/directional-light-component.ts | 5 +- cocos/core/3d/framework/light-component.ts | 9 +++- cocos/core/3d/framework/model-component.ts | 6 ++- .../core/3d/framework/renderable-component.ts | 6 ++- .../3d/framework/skinning-model-component.ts | 10 +++- .../3d/framework/sphere-light-component.ts | 23 +++++++-- .../core/3d/framework/spot-light-component.ts | 24 ++++++++-- cocos/core/animation/animation-component.ts | 14 ++++-- .../animation/skeletal-animation-component.ts | 5 +- .../components/ui-base/canvas-component.ts | 11 ++++- cocos/core/components/ui-base/ui-component.ts | 4 +- .../components/ui-base/ui-render-component.ts | 4 ++ .../ui-base/ui-transfrom-component.ts | 2 + cocos/core/platform/SubContextView.ts | 4 +- cocos/particle/animator/force-overtime.ts | 4 ++ .../animator/limit-velocity-overtime.ts | 7 +++ cocos/particle/animator/rotation-overtime.ts | 6 ++- cocos/particle/animator/size-overtime.ts | 5 ++ cocos/particle/animator/texture-animation.ts | 9 ++++ cocos/particle/animator/velocity-overtime.ts | 5 ++ cocos/particle/billboard-component.ts | 13 +++-- cocos/particle/emitter/shape-module.ts | 18 +++++++ cocos/particle/line-component.ts | 7 +++ cocos/particle/particle-system-component.ts | 34 ++++++++++++++ .../renderer/particle-system-renderer.ts | 6 +++ cocos/particle/renderer/trail.ts | 11 +++++ .../collider/box-collider-component.ts | 5 +- .../components/collider/collider-component.ts | 4 +- .../collider/sphere-collider-component.ts | 4 +- cocos/physics/components/constant-force.ts | 4 ++ .../components/rigid-body-component.ts | 8 ++++ cocos/terrain/terrain.ts | 24 +++++++--- cocos/ui/components/button-component.ts | 29 ++++++++++-- .../components/editbox/edit-box-component.ts | 45 ++++++++++++++---- cocos/ui/components/graphics-component.ts | 14 ++++-- cocos/ui/components/label-component.ts | 14 ++++++ .../ui/components/label-outline-component.ts | 8 +++- cocos/ui/components/layout-component.ts | 2 + cocos/ui/components/mask-component.ts | 1 + cocos/ui/components/page-view-component.ts | 10 +++- .../page-view-indicator-component.ts | 7 ++- cocos/ui/components/progress-bar-component.ts | 11 ++++- cocos/ui/components/rich-text-component.ts | 20 ++++++-- cocos/ui/components/scroll-bar-component.ts | 10 +++- cocos/ui/components/scroll-view-component.ts | 26 ++++++++-- cocos/ui/components/slider-component.ts | 4 ++ cocos/ui/components/sprite-component.ts | 47 +++++++++++++++---- cocos/ui/components/toggle-component.ts | 7 ++- .../components/toggle-container-component.ts | 5 +- .../components/webview/webView-component.ts | 5 +- cocos/ui/components/widget-component.ts | 26 +++++++--- 54 files changed, 559 insertions(+), 105 deletions(-) diff --git a/cocos/audio/audio-source-component.ts b/cocos/audio/audio-source-component.ts index b2fbe405ec..f63df1ee8f 100644 --- a/cocos/audio/audio-source-component.ts +++ b/cocos/audio/audio-source-component.ts @@ -60,7 +60,10 @@ export class AudioSourceComponent extends Component { * @zh * 设定要播放的音频。 */ - @property({ type: AudioClip }) + @property({ + type: AudioClip, + tooltip:'设定要播放的音频', + }) set clip (val) { this._clip = val; this._syncStates(); @@ -75,7 +78,9 @@ export class AudioSourceComponent extends Component { * @zh * 是否循环播放音频? */ - @property + @property({ + tooltip:'是否循环播放音频', + }) set loop (val) { this._loop = val; if (this._clip) { this._clip.setLoop(val); } @@ -95,7 +100,9 @@ export class AudioSourceComponent extends Component { * 请注意,根据最新的自动播放策略,现在大部分时候,自动播放只会在第一次收到用户输入后生效。
* 参考:https://www.chromium.org/audio-video/autoplay */ - @property + @property({ + tooltip:'是否启用自动播放', + }) set playOnAwake (val) { this._playOnAwake = val; } @@ -111,7 +118,10 @@ export class AudioSourceComponent extends Component { * * 请注意,在某些平台上,音量控制可能不起效。
*/ - @property + @property({ + range:[0.0,1.0], + tooltip:'音频的音量(大小范围为 0.0 到 1.0 )\n请注意,在某些平台上,音量控制可能不起效' + }) set volume (val) { if (isNaN(val)) { console.warn('illegal audio volume!'); return; } val = clamp(val, 0, 1); diff --git a/cocos/core/3d/framework/batched-skinning-model-component.ts b/cocos/core/3d/framework/batched-skinning-model-component.ts index 17addea0ef..5a323ec157 100644 --- a/cocos/core/3d/framework/batched-skinning-model-component.ts +++ b/cocos/core/3d/framework/batched-skinning-model-component.ts @@ -98,11 +98,19 @@ export class SkinningModelUnit { @menu('Components/BatchedSkinningModel') export class BatchedSkinningModelComponent extends SkinningModelComponent { - @property + @property({ + tooltip:'合图生成的最终图集的边长', + }) public atlasSize: number = 1024; - @property({ type: [CCString] }) + @property({ + type: [CCString], + tooltip:'材质中真正参与合图的贴图属性,不参与的属性统一使用第一个 unit 的贴图' + }) public batchableTextureNames: string[] = []; - @property({ type: [SkinningModelUnit] }) + @property({ + type: [SkinningModelUnit], + tooltip:'合批前的子蒙皮模型数组,最主要的数据来源', + }) public units: SkinningModelUnit[] = []; private _textures: Record = {}; diff --git a/cocos/core/3d/framework/camera-component.ts b/cocos/core/3d/framework/camera-component.ts index 847be01954..b28295dfac 100644 --- a/cocos/core/3d/framework/camera-component.ts +++ b/cocos/core/3d/framework/camera-component.ts @@ -117,6 +117,7 @@ export class CameraComponent extends Component { */ @property({ type: ProjectionType, + tooltip:'相机的投影类型', }) get projection () { return this._projection; @@ -131,7 +132,9 @@ export class CameraComponent extends Component { * @en The priority of the camera, it cannot be modified at runtime, instead, it should be set in editor. * @zh 相机的优先级顺序,只能在编辑器中设置,动态设置无效。 */ - @property + @property({ + tooltip:'相机的优先级顺序,只能在编辑器中设置,动态设置无效', + }) get priority () { return this._priority; } @@ -147,7 +150,9 @@ export class CameraComponent extends Component { * @en The camera field of view * @zh 相机的视角大小。 */ - @property + @property({ + tooltip:'相机的视角大小', + }) get fov () { return this._fov; } @@ -161,7 +166,9 @@ export class CameraComponent extends Component { * @en The camera height when in orthogonal mode * @zh 正交模式下的相机视角大小。 */ - @property + @property({ + tooltip:'正交模式下的相机视角大小', + }) get orthoHeight () { return this._orthoHeight; } @@ -175,7 +182,9 @@ export class CameraComponent extends Component { * @en The near clipping distance of the camera * @zh 相机的近平面。 */ - @property + @property({ + tooltip:'相机的近平面', + }) get near () { return this._near; } @@ -189,7 +198,9 @@ export class CameraComponent extends Component { * @en The far clipping distance of the camera * @zh 相机的远平面。 */ - @property + @property({ + tooltip:'相机的远平面', + }) get far () { return this._far; } @@ -203,7 +214,9 @@ export class CameraComponent extends Component { * @en The color clearing value of the camera * @zh 相机的颜色缓冲默认值。 */ - @property + @property({ + tooltip:'相机的颜色缓冲默认值', + }) // @constget get color (): Readonly { return this._color; @@ -223,7 +236,9 @@ export class CameraComponent extends Component { * @en The depth clearing value of the camera * @zh 相机的深度缓冲默认值。 */ - @property + @property({ + tooltip:'相机的深度缓冲默认值', + }) get depth () { return this._depth; } @@ -237,7 +252,9 @@ export class CameraComponent extends Component { * @en The stencil clearing value of the camera * @zh 相机的模板缓冲默认值。 */ - @property + @property({ + tooltip:'相机的模板缓冲默认值', + }) get stencil () { return this._stencil; } @@ -253,6 +270,7 @@ export class CameraComponent extends Component { */ @property({ type: CameraClearFlag, + tooltip:'相机的缓冲清除标志位', }) get clearFlags () { return this._clearFlags; @@ -267,7 +285,9 @@ export class CameraComponent extends Component { * @en The screen viewport of the camera wrt. sceen size * @zh 相机相对屏幕的 viewport。 */ - @property + @property({ + tooltip:'相机相对屏幕的 viewport', + }) get rect () { return this._rect; } @@ -297,6 +317,7 @@ export class CameraComponent extends Component { */ @property({ type: Layers.BitMask, + tooltip:'设置摄像机可见掩码,与 Component 中的 visibility 同时使用,用于过滤摄像机不需要渲染的物体', }) get visibility () { return this._visibility; @@ -314,6 +335,7 @@ export class CameraComponent extends Component { */ @property({ type: RenderTexture, + tooltip:'设置摄像机 RenderTexture', }) get targetTexture () { return this._targetTexture; diff --git a/cocos/core/3d/framework/directional-light-component.ts b/cocos/core/3d/framework/directional-light-component.ts index 2feab4d0fe..ed59cd9aa2 100644 --- a/cocos/core/3d/framework/directional-light-component.ts +++ b/cocos/core/3d/framework/directional-light-component.ts @@ -50,7 +50,10 @@ export class DirectionalLightComponent extends LightComponent { * @zh * 光源强度。 */ - @property({ unit: 'lx' }) + @property({ + unit: 'lx', + tooltip:'光源强度' + }) get illuminance () { return this._illuminance; } diff --git a/cocos/core/3d/framework/light-component.ts b/cocos/core/3d/framework/light-component.ts index a0a21444b5..643a5ef366 100644 --- a/cocos/core/3d/framework/light-component.ts +++ b/cocos/core/3d/framework/light-component.ts @@ -61,7 +61,9 @@ export class LightComponent extends Component { * @zh * 光源颜色。 */ - @property + @property({ + tooltip:'光源颜色', + }) // @constget get color (): Readonly { return this._color; @@ -81,7 +83,9 @@ export class LightComponent extends Component { * @zh * 是否启用光源色温。 */ - @property + @property({ + tooltip:'是否启用光源色温' + }) get useColorTemperature () { return this._useColorTemperature; } @@ -99,6 +103,7 @@ export class LightComponent extends Component { @property({ slide: true, range: [1000, 15000, 1], + tooltip:'光源色温' }) get colorTemperature () { return this._colorTemperature; diff --git a/cocos/core/3d/framework/model-component.ts b/cocos/core/3d/framework/model-component.ts index a1fca6277d..ab7bca10eb 100644 --- a/cocos/core/3d/framework/model-component.ts +++ b/cocos/core/3d/framework/model-component.ts @@ -66,6 +66,7 @@ export class ModelComponent extends RenderableComponent { */ @property({ type: Mesh, + tooltip:'模型网格', }) get mesh () { return this._mesh; @@ -84,6 +85,7 @@ export class ModelComponent extends RenderableComponent { */ @property({ type: ModelShadowCastingMode, + tooltip:'投射阴影方式', }) get shadowCastingMode () { return this._shadowCastingMode; @@ -115,7 +117,9 @@ export class ModelComponent extends RenderableComponent { /** * @zh 是否启用动态合批? */ - @property + @property({ + tooltip:'是否启用动态合批', + }) set enableDynamicBatching (enable: boolean) { if (this._enableDynamicBatching === enable) { return; } this._enableDynamicBatching = enable; diff --git a/cocos/core/3d/framework/renderable-component.ts b/cocos/core/3d/framework/renderable-component.ts index 4d6e2bd828..1ff4a4c281 100644 --- a/cocos/core/3d/framework/renderable-component.ts +++ b/cocos/core/3d/framework/renderable-component.ts @@ -12,7 +12,10 @@ const { ccclass, property } = _decorator; @ccclass('cc.RenderableComponent') export class RenderableComponent extends Component { - @property({ type: [Material] }) + @property({ + type: [Material], + tooltip:'材质', + }) protected _materials: Array = []; @property @@ -27,6 +30,7 @@ export class RenderableComponent extends Component { @property({ type: Material, displayName: 'Materials', + tooltip:'源材质', }) get sharedMaterials () { // if we don't create an array copy, the editor will modify the original array directly. diff --git a/cocos/core/3d/framework/skinning-model-component.ts b/cocos/core/3d/framework/skinning-model-component.ts index 6f03f0ffdc..3004e72cdd 100644 --- a/cocos/core/3d/framework/skinning-model-component.ts +++ b/cocos/core/3d/framework/skinning-model-component.ts @@ -57,7 +57,10 @@ export class SkinningModelComponent extends ModelComponent { * @en The bone nodes * @zh 骨骼节点。 */ - @property({ type: Skeleton }) + @property({ + type: Skeleton, + tooltip:'骨骼节点', + }) get skeleton () { return this._skeleton; } @@ -70,7 +73,10 @@ export class SkinningModelComponent extends ModelComponent { /** * 骨骼根节点的引用。 */ - @property({ type: Node }) + @property({ + type: Node, + tooltip:'骨骼蒙皮根节点', + }) get skinningRoot (): INode | null { return this._skinningRoot; } diff --git a/cocos/core/3d/framework/sphere-light-component.ts b/cocos/core/3d/framework/sphere-light-component.ts index f536cc5f80..a78b54b9d3 100644 --- a/cocos/core/3d/framework/sphere-light-component.ts +++ b/cocos/core/3d/framework/sphere-light-component.ts @@ -52,7 +52,10 @@ export class SphereLightComponent extends LightComponent { /** * 光通量。 */ - @property({ unit: 'lm' }) + @property({ + unit: 'lm', + tooltip:'光通量', + }) get luminousPower () { return this._luminance * nt2lm(this._size); } @@ -64,7 +67,10 @@ export class SphereLightComponent extends LightComponent { /** * 亮度。 */ - @property({ unit: 'cd/m²' }) + @property({ + unit: 'cd/m²', + tooltip:'亮度', + }) get luminance () { return this._luminance; } @@ -76,7 +82,10 @@ export class SphereLightComponent extends LightComponent { /** * 指定光通量或亮度。 */ - @property({ type: PhotometricTerm }) + @property({ + type: PhotometricTerm, + tooltip:'指定光通量或亮度', + }) get term () { return this._term; } @@ -90,7 +99,9 @@ export class SphereLightComponent extends LightComponent { * @zh * 针对聚光灯和点光源设置光源大小。 */ - @property + @property({ + tooltip:'针对聚光灯和点光源设置光源大小' + }) get size () { return this._size; } @@ -105,7 +116,9 @@ export class SphereLightComponent extends LightComponent { * @zh * 针对聚光灯和点光源设置光源范围。 */ - @property + @property({ + tooltip:'针对聚光灯和点光源设置光源范围', + }) get range () { return this._range; } diff --git a/cocos/core/3d/framework/spot-light-component.ts b/cocos/core/3d/framework/spot-light-component.ts index de1e7f1296..1002d6059a 100644 --- a/cocos/core/3d/framework/spot-light-component.ts +++ b/cocos/core/3d/framework/spot-light-component.ts @@ -56,7 +56,10 @@ export class SpotLightComponent extends LightComponent { /** * 光通量。 */ - @property({ unit: 'lm' }) + @property({ + unit: 'lm', + tooltip:'光通量', + }) get luminousPower () { return this._luminance * nt2lm(this._size); } @@ -68,7 +71,10 @@ export class SpotLightComponent extends LightComponent { /** * 亮度。 */ - @property({ unit: 'cd/m²' }) + @property({ + unit: 'cd/m²', + tooltip:'亮度', + }) get luminance () { return this._luminance; } @@ -80,7 +86,10 @@ export class SpotLightComponent extends LightComponent { /** * 指定光通量或亮度。 */ - @property({ type: PhotometricTerm }) + @property({ + type: PhotometricTerm, + tooltip:'指定光通量或亮度', + }) get term () { return this._term; } @@ -94,7 +103,9 @@ export class SpotLightComponent extends LightComponent { * @zh * 针对聚光灯和点光源设置光源大小。 */ - @property + @property({ + tooltip:'针对聚光灯和点光源设置光源大小', + }) get size () { return this._size; } @@ -109,7 +120,9 @@ export class SpotLightComponent extends LightComponent { * @zh * 针对聚光灯和点光源设置光源范围。 */ - @property + @property({ + tooltip:'针对聚光灯和点光源设置光源范围', + }) get range () { return this._range; } @@ -127,6 +140,7 @@ export class SpotLightComponent extends LightComponent { @property({ slide: true, range: [2, 180, 1], + tooltip:'聚光灯锥角', }) get spotAngle () { return this._spotAngle; diff --git a/cocos/core/animation/animation-component.ts b/cocos/core/animation/animation-component.ts index b483a84aa4..f46362efa7 100644 --- a/cocos/core/animation/animation-component.ts +++ b/cocos/core/animation/animation-component.ts @@ -97,7 +97,10 @@ export class AnimationComponent extends Component implements IEventTarget { * 获取此动画组件的自有动画剪辑。 * 动画组件开始运行时会为每个自有动画剪辑创建动画状态。 */ - @property({ type: [AnimationClip] }) + @property({ + type: [AnimationClip], + tooltip:'此动画组件的自有动画剪辑', + }) get clips () { return this._clips; } @@ -137,7 +140,10 @@ export class AnimationComponent extends Component implements IEventTarget { * 获取默认动画剪辑。 * @see [[playOnLoad]] */ - @property({ type: AnimationClip }) + @property({ + type: AnimationClip, + tooltip:'默认动画剪辑', + }) get defaultClip () { return this._defaultClip; } @@ -162,7 +168,9 @@ export class AnimationComponent extends Component implements IEventTarget { /** * 是否在动画组件开始运行时自动播放默认动画剪辑。 */ - @property + @property({ + tooltip:'是否在动画组件开始运行时自动播放默认动画剪辑', + }) public playOnLoad = false; public _callbackTable: ICallbackTable = createMap(true); diff --git a/cocos/core/animation/skeletal-animation-component.ts b/cocos/core/animation/skeletal-animation-component.ts index 5f5f3ef89e..4050ef3762 100644 --- a/cocos/core/animation/skeletal-animation-component.ts +++ b/cocos/core/animation/skeletal-animation-component.ts @@ -78,7 +78,10 @@ export class SkeletalAnimationComponent extends AnimationComponent { @property({ type: [Socket] }) public _sockets: Socket[] = []; - @property({ type: [Socket] }) + @property({ + type: [Socket], + tooltip:'骨骼', + }) get sockets () { return this._sockets; } diff --git a/cocos/core/components/ui-base/canvas-component.ts b/cocos/core/components/ui-base/canvas-component.ts index 2fe71911fe..341b72f99b 100644 --- a/cocos/core/components/ui-base/canvas-component.ts +++ b/cocos/core/components/ui-base/canvas-component.ts @@ -74,6 +74,7 @@ const RenderMode = Enum({ export class CanvasComponent extends Component { @property({ type: CanvasClearFlag, + tooltip:'清理屏幕缓冲标记', }) get clearFlag () { return this._clearFlag; @@ -86,7 +87,9 @@ export class CanvasComponent extends Component { } } - @property + @property({ + tooltip:'清理颜色缓冲区后的颜色', + }) get color () { return this._color; } @@ -103,6 +106,7 @@ export class CanvasComponent extends Component { @property({ type: RenderMode, + tooltip:'Canvas 渲染模式,intersperse 下可以指定 Canvas 与场景中的相机的渲染顺序,overlay 下 Canvas 会在所有场景相机渲染完成后渲染。\n注意:启用 intersperse 模式,如果 3D 场景的相机内容显示上要在 Canvas 前面,相机的 clearFlags 也要为 none', }) get renderMode () { return this._renderMode; @@ -121,7 +125,9 @@ export class CanvasComponent extends Component { * * @param value - 渲染优先级。 */ - @property() + @property({ + tooltip:'相机排序优先级。当 RenderMode 为 intersperse 时,指定与其它相机的渲染顺序,当 RenderMode 为 overlay 时,指定跟其余 Canvas 做排序使用', + }) get priority () { return this._priority; } @@ -138,6 +144,7 @@ export class CanvasComponent extends Component { */ @property({ type: RenderTexture, + tooltip:'目标渲染纹理', }) get targetTexture (){ return this._targetTexture; diff --git a/cocos/core/components/ui-base/ui-component.ts b/cocos/core/components/ui-base/ui-component.ts index a1d50ae50e..8336abbeaf 100644 --- a/cocos/core/components/ui-base/ui-component.ts +++ b/cocos/core/components/ui-base/ui-component.ts @@ -48,7 +48,9 @@ export class UIComponent extends Component { * @zh * 渲染先后顺序,按照广度渲染排列,按同级节点下进行一次排列。 */ - @property + @property({ + tooltip:'渲染排序优先级' + }) get priority () { return this._priority; } diff --git a/cocos/core/components/ui-base/ui-render-component.ts b/cocos/core/components/ui-base/ui-render-component.ts index bb81614d4d..3b643e20b1 100644 --- a/cocos/core/components/ui-base/ui-render-component.ts +++ b/cocos/core/components/ui-base/ui-render-component.ts @@ -97,6 +97,7 @@ export class UIRenderComponent extends UIComponent { @property({ type: GFXBlendFactor, displayOrder: 0, + tooltip:'原图混合模式', }) get srcBlendFactor () { return this._srcBlendFactor; @@ -124,6 +125,7 @@ export class UIRenderComponent extends UIComponent { @property({ type: GFXBlendFactor, displayOrder: 1, + tooltip:'目标混合模式', }) get dstBlendFactor () { return this._dstBlendFactor; @@ -146,6 +148,7 @@ export class UIRenderComponent extends UIComponent { */ @property({ displayOrder: 2, + tooltip:'渲染颜色', }) // @constget get color (): Readonly { @@ -171,6 +174,7 @@ export class UIRenderComponent extends UIComponent { @property({ type: Material, displayOrder: 3, + tooltip:'源材质', }) get sharedMaterial () { return this._sharedMaterial; diff --git a/cocos/core/components/ui-base/ui-transfrom-component.ts b/cocos/core/components/ui-base/ui-transfrom-component.ts index 24177fbbcc..ddec903c56 100644 --- a/cocos/core/components/ui-base/ui-transfrom-component.ts +++ b/cocos/core/components/ui-base/ui-transfrom-component.ts @@ -60,6 +60,7 @@ export class UITransformComponent extends Component { */ @property({ displayOrder: 0, + tooltip:'内容尺寸', }) // @constget get contentSize (): Readonly { @@ -138,6 +139,7 @@ export class UITransformComponent extends Component { */ @property({ displayOrder: 1, + tooltip:'锚点位置', }) // @constget get anchorPoint (): Readonly { diff --git a/cocos/core/platform/SubContextView.ts b/cocos/core/platform/SubContextView.ts index 4ec7c28d7a..83b17658f6 100644 --- a/cocos/core/platform/SubContextView.ts +++ b/cocos/core/platform/SubContextView.ts @@ -58,7 +58,9 @@ import { Rect } from '../math'; @executionOrder(110) @menu('Components/SubContextView') export class SubContextView extends Component { - @property + @property({ + tooltip:'帧数', + }) get fps (){ return this._fps; } diff --git a/cocos/particle/animator/force-overtime.ts b/cocos/particle/animator/force-overtime.ts index 64488cf196..0eab23fc9a 100644 --- a/cocos/particle/animator/force-overtime.ts +++ b/cocos/particle/animator/force-overtime.ts @@ -32,6 +32,7 @@ export default class ForceOvertimeModule { type: CurveRange, range: [-1, 1], displayOrder: 2, + tooltip:'X 轴方向上的加速度分量', }) public x = new CurveRange(); @@ -42,6 +43,7 @@ export default class ForceOvertimeModule { type: CurveRange, range: [-1, 1], displayOrder: 3, + tooltip:'Y 轴方向上的加速度分量', }) public y = new CurveRange(); @@ -52,6 +54,7 @@ export default class ForceOvertimeModule { type: CurveRange, range: [-1, 1], displayOrder: 4, + tooltip:'Z 轴方向上的加速度分量', }) public z = new CurveRange(); @@ -61,6 +64,7 @@ export default class ForceOvertimeModule { @property({ type: Space, displayOrder: 1, + tooltip:'加速度计算时采用的坐标', }) public space = Space.Local; diff --git a/cocos/particle/animator/limit-velocity-overtime.ts b/cocos/particle/animator/limit-velocity-overtime.ts index 51a0e61e2a..ab7ee9bde7 100644 --- a/cocos/particle/animator/limit-velocity-overtime.ts +++ b/cocos/particle/animator/limit-velocity-overtime.ts @@ -32,6 +32,7 @@ export default class LimitVelocityOvertimeModule { type: CurveRange, range: [-1, 1], displayOrder: 4, + tooltip:'X 轴方向上的速度下限', }) public limitX = new CurveRange(); @@ -42,6 +43,7 @@ export default class LimitVelocityOvertimeModule { type: CurveRange, range: [-1, 1], displayOrder: 5, + tooltip:'Y 轴方向上的速度下限', }) public limitY = new CurveRange(); @@ -52,6 +54,7 @@ export default class LimitVelocityOvertimeModule { type: CurveRange, range: [-1, 1], displayOrder: 6, + tooltip:'Z 轴方向上的速度下限', }) public limitZ = new CurveRange(); @@ -62,6 +65,7 @@ export default class LimitVelocityOvertimeModule { type: CurveRange, range: [-1, 1], displayOrder: 3, + tooltip:'速度下限', }) public limit = new CurveRange(); @@ -70,6 +74,7 @@ export default class LimitVelocityOvertimeModule { */ @property({ displayOrder: 7, + tooltip:'当前速度与速度下限的插值', }) public dampen = 3; @@ -78,6 +83,7 @@ export default class LimitVelocityOvertimeModule { */ @property({ displayOrder: 2, + tooltip:'是否三个轴分开限制', }) public separateAxes = false; @@ -87,6 +93,7 @@ export default class LimitVelocityOvertimeModule { @property({ type: Space, displayOrder: 1, + tooltip:'计算速度下限时采用的坐标系', }) public space = Space.Local; diff --git a/cocos/particle/animator/rotation-overtime.ts b/cocos/particle/animator/rotation-overtime.ts index fb02823cb1..92f514f734 100644 --- a/cocos/particle/animator/rotation-overtime.ts +++ b/cocos/particle/animator/rotation-overtime.ts @@ -30,6 +30,7 @@ export default class RotationOvertimeModule { */ @property({ displayOrder: 1, + tooltip:'是否三个轴分开设定旋转(暂不支持)', }) get separateAxes () { return this._separateAxes; @@ -47,6 +48,7 @@ export default class RotationOvertimeModule { range: [-1, 1], radian: true, displayOrder: 2, + tooltip:'绕 X 轴设定旋转', }) public x = new CurveRange(); @@ -58,17 +60,19 @@ export default class RotationOvertimeModule { range: [-1, 1], radian: true, displayOrder: 3, + tooltip:'绕 Y 轴设定旋转', }) public y = new CurveRange(); /** - * @zh 绕 X 轴设定旋转。 + * @zh 绕 Z 轴设定旋转。 */ @property({ type: CurveRange, range: [-1, 1], radian: true, displayOrder: 4, + tooltip:'绕 Z 轴设定旋转', }) public z = new CurveRange(); diff --git a/cocos/particle/animator/size-overtime.ts b/cocos/particle/animator/size-overtime.ts index 226f8fe31b..00d2586b5c 100644 --- a/cocos/particle/animator/size-overtime.ts +++ b/cocos/particle/animator/size-overtime.ts @@ -27,6 +27,7 @@ export default class SizeOvertimeModule { */ @property({ displayOrder: 1, + tooltip:'决定是否在每个轴上独立控制粒子大小', }) public separateAxes = false; @@ -36,6 +37,7 @@ export default class SizeOvertimeModule { @property({ type: CurveRange, displayOrder: 2, + tooltip:'定义一条曲线来决定粒子在其生命周期中的大小变化', }) public size = new CurveRange(); @@ -45,6 +47,7 @@ export default class SizeOvertimeModule { @property({ type: CurveRange, displayOrder: 3, + tooltip:'定义一条曲线来决定粒子在其生命周期中 X 轴方向上的大小变化', }) public x = new CurveRange(); @@ -54,6 +57,7 @@ export default class SizeOvertimeModule { @property({ type: CurveRange, displayOrder: 4, + tooltip:'定义一条曲线来决定粒子在其生命周期中 Y 轴方向上的大小变化', }) public y = new CurveRange(); @@ -63,6 +67,7 @@ export default class SizeOvertimeModule { @property({ type: CurveRange, displayOrder: 5, + tooltip:'定义一条曲线来决定粒子在其生命周期中 Z 轴方向上的大小变化', }) public z = new CurveRange(); diff --git a/cocos/particle/animator/texture-animation.ts b/cocos/particle/animator/texture-animation.ts index a382ac9407..a7fe168049 100644 --- a/cocos/particle/animator/texture-animation.ts +++ b/cocos/particle/animator/texture-animation.ts @@ -79,6 +79,7 @@ export default class TextureAnimationModule { @property({ type: Mode, displayOrder: 1, + tooltip:'设定粒子贴图动画的类型(暂只支持 Grid 模式)', }) get mode () { return this._mode; @@ -96,6 +97,7 @@ export default class TextureAnimationModule { */ @property({ displayOrder: 2, + tooltip:'X 方向动画帧数', }) public numTilesX = 0; @@ -104,6 +106,7 @@ export default class TextureAnimationModule { */ @property({ displayOrder: 3, + tooltip:'Y 方向动画帧数', }) public numTilesY = 0; @@ -113,6 +116,7 @@ export default class TextureAnimationModule { @property({ type: Animation, displayOrder: 4, + tooltip:'动画播放方式', }) public animation = Animation.WholeSheet; @@ -122,6 +126,7 @@ export default class TextureAnimationModule { @property({ type: CurveRange, displayOrder: 7, + tooltip:'一个周期内动画播放的帧与时间变化曲线', }) public frameOverTime = new CurveRange(); @@ -131,6 +136,7 @@ export default class TextureAnimationModule { @property({ type: CurveRange, displayOrder: 8, + tooltip:'从第几帧开始播放,时间为整个粒子系统的生命周期', }) public startFrame = new CurveRange(); @@ -139,6 +145,7 @@ export default class TextureAnimationModule { */ @property({ displayOrder: 9, + tooltip:'一个生命周期内播放循环的次数', }) public cycleCount = 0; @@ -184,6 +191,7 @@ export default class TextureAnimationModule { */ @property({ displayOrder: 5, + tooltip:'随机从动画贴图中选择一行以生成动画。\n此选项仅在动画播放方式为 SingleRow 时生效' }) public randomRow = false; @@ -193,6 +201,7 @@ export default class TextureAnimationModule { */ @property({ displayOrder: 6, + tooltip:'从动画贴图中选择特定行以生成动画。\n此选项仅在动画播放方式为 SingleRow 时且禁用 randomRow 时可用' }) public rowIndex = 0; diff --git a/cocos/particle/animator/velocity-overtime.ts b/cocos/particle/animator/velocity-overtime.ts index d842f79d20..af6de5fda1 100644 --- a/cocos/particle/animator/velocity-overtime.ts +++ b/cocos/particle/animator/velocity-overtime.ts @@ -35,6 +35,7 @@ export default class VelocityOvertimeModule { type: CurveRange, range: [-1, 1], displayOrder: 2, + tooltip:'X 轴方向上的速度分量', }) public x = new CurveRange(); @@ -45,6 +46,7 @@ export default class VelocityOvertimeModule { type: CurveRange, range: [-1, 1], displayOrder: 3, + tooltip:'Y 轴方向上的速度分量', }) public y = new CurveRange(); @@ -55,6 +57,7 @@ export default class VelocityOvertimeModule { type: CurveRange, range: [-1, 1], displayOrder: 4, + tooltip:'Z 轴方向上的速度分量', }) public z = new CurveRange(); @@ -65,6 +68,7 @@ export default class VelocityOvertimeModule { type: CurveRange, range: [-1, 1], displayOrder: 5, + tooltip:'速度修正系数(只支持 CPU 粒子)', }) public speedModifier = new CurveRange(); @@ -74,6 +78,7 @@ export default class VelocityOvertimeModule { @property({ type: Space, displayOrder: 1, + tooltip:'速度计算时采用的坐标系', }) public space = Space.Local; diff --git a/cocos/particle/billboard-component.ts b/cocos/particle/billboard-component.ts index fa61d6873f..2a9c57b0d4 100644 --- a/cocos/particle/billboard-component.ts +++ b/cocos/particle/billboard-component.ts @@ -29,6 +29,7 @@ export class BillboardComponent extends Component { */ @property({ type: Texture2D, + tooltip:'billboard显示的贴图', }) get texture () { return this._texture; @@ -47,7 +48,9 @@ export class BillboardComponent extends Component { /** * @zh 高度。 */ - @property + @property({ + tooltip:'billboard的高度', + }) get height () { return this._height; } @@ -66,7 +69,9 @@ export class BillboardComponent extends Component { /** * @zh 宽度。 */ - @property + @property({ + tooltip:'billboard的宽度', + }) public get width () { return this._width; } @@ -85,7 +90,9 @@ export class BillboardComponent extends Component { /** * @zh 角度。 */ - @property + @property({ + tooltip:'billboard绕中心点旋转的角度', + }) public get rotation () { return Math.round(toDegree(this._rotation) * 100) / 100; } diff --git a/cocos/particle/emitter/shape-module.ts b/cocos/particle/emitter/shape-module.ts index a81917097b..e0ccbfc7c9 100644 --- a/cocos/particle/emitter/shape-module.ts +++ b/cocos/particle/emitter/shape-module.ts @@ -24,6 +24,7 @@ export default class ShapeModule { */ @property({ displayOrder: 13, + tooltip:'粒子发射器位置', }) get position () { return this._position; @@ -38,6 +39,7 @@ export default class ShapeModule { */ @property({ displayOrder: 14, + tooltip:'粒子发射器旋转角度', }) get rotation () { return this._rotation; @@ -52,6 +54,7 @@ export default class ShapeModule { */ @property({ displayOrder: 15, + tooltip:'粒子发射器缩放比例', }) get scale () { return this._scale; @@ -66,6 +69,7 @@ export default class ShapeModule { */ @property({ displayOrder: 6, + tooltip:'粒子发射器在一个扇形范围内发射', }) get arc () { return toDegree(this._arc); @@ -81,6 +85,7 @@ export default class ShapeModule { */ @property({ displayOrder: 5, + tooltip:'圆锥的轴与母线的夹角\n决定圆锥发射器的开合程度', }) get angle () { return Math.round(toDegree(this._angle) * 100) / 100; @@ -110,6 +115,7 @@ export default class ShapeModule { @property({ type: ShapeType, + tooltip:'粒子发射器类型', }) public get shapeType () { return this._shapeType; @@ -143,6 +149,7 @@ export default class ShapeModule { @property({ type: EmitLocation, displayOrder: 2, + tooltip:'粒子从发射器哪个部位发射', }) public emitFrom = EmitLocation.Volume; @@ -151,6 +158,7 @@ export default class ShapeModule { */ @property({ displayOrder: 16, + tooltip:'根据粒子的初始方向决定粒子的移动方向', }) public alignToDirection = false; @@ -159,6 +167,7 @@ export default class ShapeModule { */ @property({ displayOrder: 17, + tooltip:'粒子生成方向随机设定', }) public randomDirectionAmount = 0; @@ -167,6 +176,7 @@ export default class ShapeModule { */ @property({ displayOrder: 18, + tooltip:'表示当前发射方向与当前位置到结点中心连线方向的插值', }) public sphericalDirectionAmount = 0; @@ -175,6 +185,7 @@ export default class ShapeModule { */ @property({ displayOrder: 19, + tooltip:'粒子生成位置随机设定(设定此值为非 0 会使粒子生成位置超出生成器大小范围)', }) public randomPositionAmount = 0; @@ -183,6 +194,7 @@ export default class ShapeModule { */ @property({ displayOrder: 3, + tooltip:'粒子发射器半径', }) public radius = 1; @@ -194,6 +206,7 @@ export default class ShapeModule { */ @property({ displayOrder: 4, + tooltip:'粒子发射器发射位置(对 Box 类型的发射器无效):\n - 0 表示从表面发射;\n - 1 表示从中心发射;\n - 0 ~ 1 之间表示在中心到表面之间发射。', }) public radiusThickness = 1; @@ -203,6 +216,7 @@ export default class ShapeModule { @property({ type: ArcMode, displayOrder: 7, + tooltip:'粒子在扇形范围内的发射方式', }) public arcMode = ArcMode.Random; @@ -211,6 +225,7 @@ export default class ShapeModule { */ @property({ displayOrder: 9, + tooltip:'控制可能产生粒子的弧周围的离散间隔', }) public arcSpread = 0; @@ -220,6 +235,7 @@ export default class ShapeModule { @property({ type: CurveRange, displayOrder: 10, + tooltip:'粒子沿圆周发射的速度', }) public arcSpeed = new CurveRange(); @@ -229,6 +245,7 @@ export default class ShapeModule { */ @property({ displayOrder: 11, + tooltip:'圆锥顶部截面距离底部的轴长\n决定圆锥发射器的高度', }) public length = 5; @@ -237,6 +254,7 @@ export default class ShapeModule { */ @property({ displayOrder: 12, + tooltip:'粒子发射器发射位置(针对 Box 类型的粒子发射器)', }) public boxThickness = new Vec3(0, 0, 0); diff --git a/cocos/particle/line-component.ts b/cocos/particle/line-component.ts index 6d09ffda53..b136fc08d5 100644 --- a/cocos/particle/line-component.ts +++ b/cocos/particle/line-component.ts @@ -32,6 +32,7 @@ export class LineComponent extends Component { @property({ type: Texture2D, displayOrder: 0, + tooltip:'线段中显示的贴图', }) get texture () { return this._texture; @@ -54,6 +55,7 @@ export class LineComponent extends Component { */ @property({ displayOrder: 1, + tooltip:'线段中各个点的坐标采用哪个坐标系,勾选使用世界坐标系,不选使用本地坐标系', }) get worldSpace () { return this._worldSpace; @@ -81,6 +83,7 @@ export class LineComponent extends Component { @property({ type: [Vec3], displayOrder: 2, + tooltip:'每个线段端点的坐标', }) get positions () { return this._positions; @@ -104,6 +107,7 @@ export class LineComponent extends Component { @property({ type: CurveRange, displayOrder: 3, + tooltip:'线段宽度,如果采用曲线,则表示沿着线段方向上的曲线变化', }) get width () { return this._width; @@ -125,6 +129,7 @@ export class LineComponent extends Component { @property({ type: Vec2, displayOrder: 4, + tooltip:'贴图平铺次数', }) get tile () { return this._tile; @@ -145,6 +150,7 @@ export class LineComponent extends Component { @property({ type: Vec2, displayOrder: 5, + tooltip:'贴图坐标的偏移', }) get offset () { return this._offset; @@ -170,6 +176,7 @@ export class LineComponent extends Component { @property({ type: GradientRange, displayOrder: 6, + tooltip:'线段颜色,如果采用渐变色,则表示沿着线段方向上的颜色渐变', }) get color () { return this._color; diff --git a/cocos/particle/particle-system-component.ts b/cocos/particle/particle-system-component.ts index f613548baa..5cd8d6b8dd 100644 --- a/cocos/particle/particle-system-component.ts +++ b/cocos/particle/particle-system-component.ts @@ -41,6 +41,7 @@ export class ParticleSystemComponent extends RenderableComponent { */ @property({ displayOrder: 1, + tooltip:'粒子系统能生成的最大粒子数量', }) public get capacity () { return this._capacity; @@ -61,17 +62,20 @@ export class ParticleSystemComponent extends RenderableComponent { @property({ type: GradientRange, displayOrder: 8, + tooltip:'粒子初始颜色', }) public startColor = new GradientRange(); @property({ type: Space, displayOrder: 9, + tooltip:'选择缩放坐标系', }) public scaleSpace = Space.Local; @property({ displayOrder: 10, + tooltip:'粒子初始大小', }) public startSize3D = false; @@ -82,6 +86,7 @@ export class ParticleSystemComponent extends RenderableComponent { type: CurveRange, displayOrder: 10, formerlySerializedAs: 'startSize', + tooltip:'粒子初始大小', }) public startSizeX = new CurveRange(); @@ -91,6 +96,7 @@ export class ParticleSystemComponent extends RenderableComponent { @property({ type: CurveRange, displayOrder: 10, + tooltip:'粒子初始大小', }) public startSizeY = new CurveRange(); @@ -100,6 +106,7 @@ export class ParticleSystemComponent extends RenderableComponent { @property({ type: CurveRange, displayOrder: 10, + tooltip:'粒子初始大小', }) public startSizeZ = new CurveRange(); @@ -110,11 +117,13 @@ export class ParticleSystemComponent extends RenderableComponent { type: CurveRange, range: [-1, 1], displayOrder: 11, + tooltip:'粒子初始速度', }) public startSpeed = new CurveRange(); @property({ displayOrder: 12, + tooltip:'粒子初始旋转角度', }) public startRotation3D = false; @@ -126,6 +135,7 @@ export class ParticleSystemComponent extends RenderableComponent { range: [-1, 1], radian: true, displayOrder: 12, + tooltip:'粒子初始旋转角度' }) public startRotationX = new CurveRange(); @@ -137,6 +147,7 @@ export class ParticleSystemComponent extends RenderableComponent { range: [-1, 1], radian: true, displayOrder: 12, + tooltip:'粒子初始旋转角度' }) public startRotationY = new CurveRange(); @@ -149,6 +160,7 @@ export class ParticleSystemComponent extends RenderableComponent { radian: true, displayOrder: 12, formerlySerializedAs: 'startRotation', + tooltip:'粒子初始旋转角度' }) public startRotationZ = new CurveRange(); @@ -158,6 +170,7 @@ export class ParticleSystemComponent extends RenderableComponent { @property({ type: CurveRange, displayOrder: 6, + tooltip:'粒子系统开始运行后,延迟粒子发射的时间', }) public startDelay = new CurveRange(); @@ -167,6 +180,7 @@ export class ParticleSystemComponent extends RenderableComponent { @property({ type: CurveRange, displayOrder: 7, + tooltip:'粒子生命周期', }) public startLifetime = new CurveRange(); @@ -175,6 +189,7 @@ export class ParticleSystemComponent extends RenderableComponent { */ @property({ displayOrder: 0, + tooltip:'粒子系统运行时间', }) public duration = 5.0; @@ -183,6 +198,7 @@ export class ParticleSystemComponent extends RenderableComponent { */ @property({ displayOrder: 2, + tooltip:'粒子系统是否循环播放', }) public loop = true; @@ -191,6 +207,7 @@ export class ParticleSystemComponent extends RenderableComponent { */ @property({ displayOrder: 3, + tooltip:'选中之后,粒子系统会以已播放完一轮之后的状态开始播放(仅当循环播放启用时有效)', }) get prewarm () { return this._prewarm; @@ -209,6 +226,7 @@ export class ParticleSystemComponent extends RenderableComponent { @property({ type: Space, displayOrder: 4, + tooltip:'控制粒子坐标计算所在的坐标系', }) get simulationSpace () { return this._simulationSpace; @@ -227,6 +245,7 @@ export class ParticleSystemComponent extends RenderableComponent { */ @property({ displayOrder: 5, + tooltip:'控制整个粒子系统的更新速度', }) public simulationSpeed = 1.0; @@ -235,6 +254,7 @@ export class ParticleSystemComponent extends RenderableComponent { */ @property({ displayOrder: 2, + tooltip:'粒子系统加载后是否自动开始播放', }) public playOnAwake = true; @@ -245,6 +265,7 @@ export class ParticleSystemComponent extends RenderableComponent { type: CurveRange, range: [-1, 1], displayOrder: 13, + tooltip:'粒子受重力影响的重力系数', }) public gravityModifier = new CurveRange(); @@ -255,6 +276,7 @@ export class ParticleSystemComponent extends RenderableComponent { @property({ type: CurveRange, displayOrder: 14, + tooltip:'每秒发射的粒子数', }) public rateOverTime = new CurveRange(); @@ -264,6 +286,7 @@ export class ParticleSystemComponent extends RenderableComponent { @property({ type: CurveRange, displayOrder: 15, + tooltip:'每移动单位距离发射的粒子数', }) public rateOverDistance = new CurveRange(); @@ -273,6 +296,7 @@ export class ParticleSystemComponent extends RenderableComponent { @property({ type: [Burst], displayOrder: 16, + tooltip:'在某个时间点发射给定数量的粒子' }) public bursts = new Array(); @@ -300,6 +324,7 @@ export class ParticleSystemComponent extends RenderableComponent { @property({ type: ColorOverLifetimeModule, displayOrder: 23, + tooltip:'颜色模块', }) public colorOverLifetimeModule = new ColorOverLifetimeModule(); @@ -310,6 +335,7 @@ export class ParticleSystemComponent extends RenderableComponent { @property({ type: ShapeModule, displayOrder: 17, + tooltip:'发射器模块', }) public shapeModule = new ShapeModule(); @@ -320,6 +346,7 @@ export class ParticleSystemComponent extends RenderableComponent { @property({ type: SizeOvertimeModule, displayOrder: 21, + tooltip:'大小模块', }) public sizeOvertimeModule = new SizeOvertimeModule(); @@ -329,6 +356,7 @@ export class ParticleSystemComponent extends RenderableComponent { @property({ type: VelocityOvertimeModule, displayOrder: 18, + tooltip:'速度模块', }) public velocityOvertimeModule = new VelocityOvertimeModule(); @@ -338,6 +366,7 @@ export class ParticleSystemComponent extends RenderableComponent { @property({ type: ForceOvertimeModule, displayOrder: 19, + tooltip:'加速度模块', }) public forceOvertimeModule = new ForceOvertimeModule(); @@ -347,6 +376,7 @@ export class ParticleSystemComponent extends RenderableComponent { @property({ type: LimitVelocityOvertimeModule, displayOrder: 20, + tooltip:'限速模块', }) public limitVelocityOvertimeModule = new LimitVelocityOvertimeModule(); @@ -356,6 +386,7 @@ export class ParticleSystemComponent extends RenderableComponent { @property({ type: RotationOvertimeModule, displayOrder: 22, + tooltip:'旋转模块', }) public rotationOvertimeModule = new RotationOvertimeModule(); @@ -365,6 +396,7 @@ export class ParticleSystemComponent extends RenderableComponent { @property({ type: TextureAnimationModule, displayOrder: 24, + tooltip:'贴图动画模块', }) public textureAnimationModule = new TextureAnimationModule(); @@ -374,6 +406,7 @@ export class ParticleSystemComponent extends RenderableComponent { @property({ type: TrailModule, displayOrder: 25, + tooltip:'拖尾模块', }) public trailModule = new TrailModule(); @@ -381,6 +414,7 @@ export class ParticleSystemComponent extends RenderableComponent { @property({ type: ParticleSystemRenderer, displayOrder: 26, + tooltip:'渲染模块', }) public renderer: ParticleSystemRenderer = new ParticleSystemRenderer(); diff --git a/cocos/particle/renderer/particle-system-renderer.ts b/cocos/particle/renderer/particle-system-renderer.ts index 7b32ef14d0..14f1e15f5f 100644 --- a/cocos/particle/renderer/particle-system-renderer.ts +++ b/cocos/particle/renderer/particle-system-renderer.ts @@ -66,6 +66,7 @@ export default class ParticleSystemRenderer { @property({ type: RenderMode, displayOrder: 0, + tooltip:'设定粒子生成模式', }) public get renderMode () { return this._renderMode; @@ -86,6 +87,7 @@ export default class ParticleSystemRenderer { */ @property({ displayOrder: 1, + tooltip:'在粒子生成方式为 StrecthedBillboard 时,对粒子在运动方向上按速度大小进行拉伸', }) public get velocityScale () { return this._velocityScale; @@ -102,6 +104,7 @@ export default class ParticleSystemRenderer { */ @property({ displayOrder: 2, + tooltip:'在粒子生成方式为 StrecthedBillboard 时,对粒子在运动方向上按粒子大小进行拉伸', }) public get lengthScale () { return this._lengthScale; @@ -146,6 +149,7 @@ export default class ParticleSystemRenderer { @property({ type: Mesh, displayOrder: 7, + tooltip:'粒子发射的模型', }) public get mesh () { return this._mesh; @@ -164,6 +168,7 @@ export default class ParticleSystemRenderer { @property({ type: Material, displayOrder: 8, + tooltip:'粒子使用的材质', }) public get particleMaterial () { if (!this._particleSystem) { @@ -182,6 +187,7 @@ export default class ParticleSystemRenderer { @property({ type: Material, displayOrder: 9, + tooltip:'拖尾使用的材质', }) public get trailMaterial () { if (!this._particleSystem) { diff --git a/cocos/particle/renderer/trail.ts b/cocos/particle/renderer/trail.ts index b99ec9ed4f..927893fac2 100644 --- a/cocos/particle/renderer/trail.ts +++ b/cocos/particle/renderer/trail.ts @@ -178,6 +178,7 @@ export default class TrailModule { @property({ type: TrailMode, displayOrder: 1, + tooltip:'Particle在每个粒子的运动轨迹上形成拖尾效果', }) public mode = TrailMode.Particles; @@ -187,6 +188,7 @@ export default class TrailModule { @property({ type: CurveRange, displayOrder: 3, + tooltip:'拖尾的生命周期', }) public lifeTime = new CurveRange(); @@ -198,6 +200,7 @@ export default class TrailModule { */ @property({ displayOrder: 5, + tooltip:'粒子每生成一个拖尾节点所运行的最短距离', }) public get minParticleDistance () { return this._minParticleDistance; @@ -211,6 +214,7 @@ export default class TrailModule { @property({ type: Space, displayOrder: 6, + tooltip:'拖尾所在的坐标系,World在世界坐标系中运行,Local在本地坐标系中运行', }) public get space () { return this._space; @@ -228,6 +232,7 @@ export default class TrailModule { */ @property({ displayOrder: 7, + tooltip:'拖尾是否跟随粒子一起消失', }) public existWithParticles = true; @@ -237,11 +242,13 @@ export default class TrailModule { @property({ type: TextureMode, displayOrder: 8, + tooltip:'贴图在拖尾上的展开形式,Stretch贴图覆盖在整条拖尾上,Repeat贴图覆盖在一段拖尾上', }) public textureMode = TextureMode.Stretch; @property({ displayOrder: 9, + tooltip:'拖尾宽度继承自粒子大小' }) public widthFromParticle = true; @@ -251,23 +258,27 @@ export default class TrailModule { @property({ type: CurveRange, displayOrder: 10, + tooltip:'拖尾宽度,如果继承自粒子则是粒子大小的比例', }) public widthRatio = new CurveRange(); @property({ displayOrder: 11, + tooltip:'拖尾颜色是否继承自粒子' }) public colorFromParticle = false; @property({ type: GradientRange, displayOrder: 12, + tooltip:'拖尾颜色随拖尾自身长度的颜色渐变' }) public colorOverTrail = new GradientRange(); @property({ type: GradientRange, displayOrder: 13, + tooltip:'拖尾颜色随时间的颜色渐变' }) public colorOvertime = new GradientRange(); diff --git a/cocos/physics/components/collider/box-collider-component.ts b/cocos/physics/components/collider/box-collider-component.ts index 5d89885aae..29a4b1218f 100644 --- a/cocos/physics/components/collider/box-collider-component.ts +++ b/cocos/physics/components/collider/box-collider-component.ts @@ -59,7 +59,10 @@ export class BoxColliderComponent extends ColliderComponent { * @zh * 获取或设置盒的大小。 */ - @property({ type: Vec3 }) + @property({ + type: Vec3, + tooltip:'盒的大小,即长、宽、高' + }) public get size () { return this._size; } diff --git a/cocos/physics/components/collider/collider-component.ts b/cocos/physics/components/collider/collider-component.ts index 86264bc8d2..3ffd5047f3 100644 --- a/cocos/physics/components/collider/collider-component.ts +++ b/cocos/physics/components/collider/collider-component.ts @@ -35,6 +35,7 @@ export class ColliderComponent extends PhysicsBasedComponent implements IEventTa type: PhysicMaterial, displayName: 'Material', displayOrder: -1, + tooltip:'源材质', }) public get sharedMaterial () { return this._material; @@ -92,6 +93,7 @@ export class ColliderComponent extends PhysicsBasedComponent implements IEventTa */ @property({ displayOrder: 0, + tooltip:'是否与其它碰撞器产生碰撞,并产生物理行为', }) public get isTrigger () { return this._isTrigger; @@ -120,7 +122,7 @@ export class ColliderComponent extends PhysicsBasedComponent implements IEventTa @property({ type: Vec3, displayOrder: 1, - tooltip: 'The center of the collider, in local space', + tooltip:'形状的中心点(与所在 Node 中心点的相对位置)', }) public get center () { return this._center; diff --git a/cocos/physics/components/collider/sphere-collider-component.ts b/cocos/physics/components/collider/sphere-collider-component.ts index 92e10ee015..4b22e81ea9 100644 --- a/cocos/physics/components/collider/sphere-collider-component.ts +++ b/cocos/physics/components/collider/sphere-collider-component.ts @@ -56,7 +56,9 @@ export class SphereColliderComponent extends ColliderComponent { * @zh * 获取或设置球的半径。 */ - @property + @property({ + tooltip:'球的半径', + }) public get radius () { return this._radius; } diff --git a/cocos/physics/components/constant-force.ts b/cocos/physics/components/constant-force.ts index 39903c7870..14540ac5a9 100644 --- a/cocos/physics/components/constant-force.ts +++ b/cocos/physics/components/constant-force.ts @@ -51,6 +51,7 @@ export class ConstantForce extends Component { */ @property({ displayOrder: 0, + tooltip:'世界朝向的力', }) public get force () { return this._force; @@ -69,6 +70,7 @@ export class ConstantForce extends Component { */ @property({ displayOrder: 1, + tooltip:'本地朝向的力', }) public get localForce () { return this._localForce; @@ -87,6 +89,7 @@ export class ConstantForce extends Component { */ @property({ displayOrder: 2, + tooltip:'世界朝向的扭转力', }) public get torque () { return this._torque; @@ -105,6 +108,7 @@ export class ConstantForce extends Component { */ @property({ displayOrder: 3, + tooltip:'本地朝向的扭转力', }) public get localTorque () { return this._localTorque; diff --git a/cocos/physics/components/rigid-body-component.ts b/cocos/physics/components/rigid-body-component.ts index 5fa53dbe45..8ea671283d 100644 --- a/cocos/physics/components/rigid-body-component.ts +++ b/cocos/physics/components/rigid-body-component.ts @@ -57,6 +57,7 @@ export class RigidBodyComponent extends PhysicsBasedComponent { */ @property({ displayOrder: 0, + tooltip:'刚体的质量', }) public get mass () { return this._mass; @@ -75,6 +76,7 @@ export class RigidBodyComponent extends PhysicsBasedComponent { */ @property({ displayOrder: 1, + tooltip:'线性阻尼', }) public get linearDamping () { return this._linearDamping; @@ -93,6 +95,7 @@ export class RigidBodyComponent extends PhysicsBasedComponent { */ @property({ displayOrder: 2, + tooltip:'旋转阻尼', }) public get angularDamping () { return this._angularDamping; @@ -111,6 +114,7 @@ export class RigidBodyComponent extends PhysicsBasedComponent { */ @property({ displayOrder: 3, + tooltip:'刚体是否由物理系统控制运动', }) public get isKinematic () { return this._isKinematic; @@ -129,6 +133,7 @@ export class RigidBodyComponent extends PhysicsBasedComponent { */ @property({ displayOrder: 4, + tooltip:'刚体是否使用重力', }) public get useGravity () { return this._useGravity; @@ -147,6 +152,7 @@ export class RigidBodyComponent extends PhysicsBasedComponent { */ @property({ displayOrder: 5, + tooltip:'刚体是否固定旋转', }) public get fixedRotation () { return this._fixedRotation; @@ -165,6 +171,7 @@ export class RigidBodyComponent extends PhysicsBasedComponent { */ @property({ displayOrder: 6, + tooltip:'线性速度的因子,可以用来控制每个轴方向上的速度的缩放', }) public get linearFactor () { if (CC_EDITOR) { @@ -187,6 +194,7 @@ export class RigidBodyComponent extends PhysicsBasedComponent { */ @property({ displayOrder: 7, + tooltip:'旋转速度的因子,可以用来控制每个轴方向上的旋转速度的缩放', }) public get angularFactor () { if (CC_EDITOR) { diff --git a/cocos/terrain/terrain.ts b/cocos/terrain/terrain.ts index 47586cfb0f..35a498a59b 100644 --- a/cocos/terrain/terrain.ts +++ b/cocos/terrain/terrain.ts @@ -37,16 +37,24 @@ export const TERRAIN_EAST_INDEX = 3; */ @ccclass('cc.TerrainInfo') export class TerrainInfo { - @property + @property({ + tooltip:'地形Tile的大小', + }) public tileSize: number = 1; - @property + @property({ + tooltip:'地形块在两个维度上的数量', + }) public blockCount: number[] = [1, 1]; - @property + @property({ + tooltip:'权重图大小', + }) public weightMapSize: number = 128; - @property + @property({ + tooltip:'光照贴图大小', + }) public lightMapSize: number = 128; // @@ -78,9 +86,13 @@ export class TerrainInfo { @ccclass('cc.TerrainLayer') export class TerrainLayer { - @property + @property({ + tooltip:'当前Layer的纹理', + }) public detailMap: Texture2D|null = null; - @property + @property({ + tooltip:'纹理的平铺大小,值越小会在同样大小的区域内进行更多次的平铺', + }) public tileSize: number = 1; } diff --git a/cocos/ui/components/button-component.ts b/cocos/ui/components/button-component.ts index e9e1370739..49ce64f4fe 100644 --- a/cocos/ui/components/button-component.ts +++ b/cocos/ui/components/button-component.ts @@ -128,6 +128,7 @@ export class ButtonComponent extends Component { */ @property({ displayOrder: 1, + tooltip:'按钮是否可交互,这一项未选中时,按钮处在禁用状态', }) get interactable () { return this._interactable; @@ -162,6 +163,7 @@ export class ButtonComponent extends Component { @property({ type: Transition, displayOrder: 2, + tooltip:'按钮状态变化时的过渡类型', }) get transition () { return this._transition; @@ -181,7 +183,9 @@ export class ButtonComponent extends Component { * @zh * 普通状态下按钮所显示的颜色。 */ - @property + @property({ + tooltip:'普通状态的按钮背景颜色', + }) // @constget get normalColor (): Readonly { return this._normalColor; @@ -200,7 +204,9 @@ export class ButtonComponent extends Component { * @zh * 按下状态时按钮所显示的颜色。 */ - @property + @property({ + tooltip:'按下状态的按钮背景颜色', + }) // @constget get pressedColor (): Readonly { return this._pressColor; @@ -218,7 +224,9 @@ export class ButtonComponent extends Component { * @zh * 悬停状态下按钮所显示的颜色。 */ - @property + @property({ + tooltip:'悬停状态的按钮背景颜色', + }) // @constget get hoverColor (): Readonly { return this._hoverColor; @@ -235,7 +243,9 @@ export class ButtonComponent extends Component { * @zh * 禁用状态下按钮所显示的颜色。 */ - @property + @property({ + tooltip:'禁用状态的按钮背景颜色', + }) // @constget get disabledColor (): Readonly { return this._disabledColor; @@ -257,6 +267,7 @@ export class ButtonComponent extends Component { @property({ min: 0, max: 10, + tooltip:'按钮颜色变化或者缩放变化的过渡时间', }) get duration () { return this._duration; @@ -274,7 +285,9 @@ export class ButtonComponent extends Component { * @zh * 当用户点击按钮后,按钮会缩放到一个值,这个值等于 Button 原始 scale * zoomScale。 */ - @property + @property({ + tooltip:'当用户点击按钮后,按钮会缩放到一个值,这个值等于 Button 原始 scale * zoomScale。', + }) get zoomScale () { return this._zoomScale; } @@ -294,6 +307,7 @@ export class ButtonComponent extends Component { */ @property({ type: SpriteFrame, + tooltip:'普通状态的按钮背景图资源', }) get normalSprite () { return this._normalSprite; @@ -319,6 +333,7 @@ export class ButtonComponent extends Component { */ @property({ type: SpriteFrame, + tooltip:'按下状态的按钮背景图资源', }) get pressedSprite () { return this._pressedSprite; @@ -339,6 +354,7 @@ export class ButtonComponent extends Component { */ @property({ type: SpriteFrame, + tooltip:'悬停状态的按钮背景图资源', }) get hoverSprite () { return this._hoverSprite; @@ -359,6 +375,7 @@ export class ButtonComponent extends Component { */ @property({ type: SpriteFrame, + tooltip:'禁用状态的按钮背景图资源', }) get disabledSprite () { return this._disabledSprite; @@ -384,6 +401,7 @@ export class ButtonComponent extends Component { @property({ type: Node, displayOrder: 0, + tooltip:'指定 Button 背景节点,Button 状态改变时会修改此节点的 Color 或 Sprite 属性', }) get target () { return this._target; @@ -406,6 +424,7 @@ export class ButtonComponent extends Component { @property({ type: [ComponentEventHandler], displayOrder: 3, + tooltip:'按钮点击事件的列表。先将数量改为1或更多,就可以为每个点击事件设置接受者和处理方法', }) public clickEvents: ComponentEventHandler[] = []; @property diff --git a/cocos/ui/components/editbox/edit-box-component.ts b/cocos/ui/components/editbox/edit-box-component.ts index 394a0af5c7..c5304ba905 100644 --- a/cocos/ui/components/editbox/edit-box-component.ts +++ b/cocos/ui/components/editbox/edit-box-component.ts @@ -76,7 +76,9 @@ export class EditBoxComponent extends Component { * @zh * 输入框的初始输入内容,如果为空则会显示占位符的文本。 */ - @property + @property({ + tooltip:'输入框的初始输入内容,如果为空则会显示占位符的文本', + }) get string () { return this._string; } @@ -101,6 +103,7 @@ export class EditBoxComponent extends Component { */ @property({ type: SpriteFrame, + tooltip:'输入框的背景图片', }) get backgroundImage () { return this._backgroundImage; @@ -126,6 +129,7 @@ export class EditBoxComponent extends Component { */ @property({ type: KeyboardReturnType, + tooltip:'指定移动设备上面回车按钮的样式', }) get returnType () { return this._returnType; @@ -147,6 +151,7 @@ export class EditBoxComponent extends Component { */ @property({ type: InputFlag, + tooltip:'指定输入标志位,可以指定输入方式为密码或者单词首字母大写' }) get inputFlag () { return this._inputFlag; @@ -169,6 +174,7 @@ export class EditBoxComponent extends Component { */ @property({ type: InputMode, + tooltip:'指定输入模式: ANY 表示多行输入,其它都是单行输入,移动平台上还可以指定键盘样式' }) get inputMode () { return this._inputMode; @@ -188,7 +194,9 @@ export class EditBoxComponent extends Component { * @zh * 输入框文本的字体大小。 */ - @property + @property({ + tooltip:'输入框文本的字体大小', + }) get fontSize () { return this._fontSize; } @@ -214,7 +222,9 @@ export class EditBoxComponent extends Component { * @zh * 输入框文本的行高。 */ - @property + @property({ + tooltip:'输入框文本的行高' + }) get lineHeight () { return this._lineHeight; } @@ -239,6 +249,7 @@ export class EditBoxComponent extends Component { */ @property({ type: Color, + tooltip:'输入框文本的颜色', }) get fontColor () { return this._fontColor; @@ -269,7 +280,9 @@ export class EditBoxComponent extends Component { * @zh * 输入框占位符的文本内容。 */ - @property + @property({ + tooltip:'输入框占位符的文本内容', + }) get placeholder () { return this._placeholder; } @@ -295,7 +308,9 @@ export class EditBoxComponent extends Component { * @zh * 输入框占位符的字体大小。 */ - @property + @property({ + tooltip:'输入框占位符的字体大小' + }) get placeholderFontSize () { return this._placeholderFontSize; } @@ -318,7 +333,9 @@ export class EditBoxComponent extends Component { * @zh * 输入框占位符的字体颜色。 */ - @property + @property({ + tooltip:'输入框占位符的字体颜色', + }) get placeholderFontColor () { return this._placeholderFontColor; } @@ -347,7 +364,9 @@ export class EditBoxComponent extends Component { * - 如果值为小于 0 的值,则不会限制输入字符个数。 * - 如果值为 0,则不允许用户进行任何输入。 */ - @property + @property({ + tooltip:'输入框最大允许输入的字符个数', + }) get maxLength () { return this._maxLength; } @@ -370,7 +389,9 @@ export class EditBoxComponent extends Component { * 输入框总是可见,并且永远在游戏视图的上面(这个属性只有在 Web 上面修改有意义) * Note: only available on Web at the moment. */ - @property + @property({ + tooltip:'输入框总是可见,并且永远在游戏视图的上面(这个属性只有在 Web 上面修改有意义)' + }) get stayOnTop () { return this._stayOnTop; } @@ -389,7 +410,9 @@ export class EditBoxComponent extends Component { * @zh * 修改 DOM 输入元素的 tabIndex(这个属性只有在 Web 上面修改有意义)。 */ - @property + @property({ + tooltip:'修改 DOM 输入元素的 tabIndex(这个属性只有在 Web 上面修改有意义)', + }) get tabIndex () { return this._tabIndex; } @@ -414,6 +437,7 @@ export class EditBoxComponent extends Component { */ @property({ type: [ComponentEventHandler], + tooltip:'该事件在用户点击输入框获取焦点的时候被触发', }) public editingDidBegan: ComponentEventHandler[] = []; @@ -426,6 +450,7 @@ export class EditBoxComponent extends Component { */ @property({ type: [ComponentEventHandler], + tooltip:'编辑文本输入框时触发的事件回调' }) public textChanged: ComponentEventHandler[] = []; @@ -438,6 +463,7 @@ export class EditBoxComponent extends Component { */ @property({ type: [ComponentEventHandler], + tooltip:'在单行模式下面,一般是在用户按下回车或者点击屏幕输入框以外的地方调用该函数。 如果是多行输入,一般是在用户点击屏幕输入框以外的地方调用该函数', }) public editingDidEnded: ComponentEventHandler[] = []; @@ -450,6 +476,7 @@ export class EditBoxComponent extends Component { */ @property({ type: [ComponentEventHandler], + tooltip:'该事件在用户按下回车键的时候被触发, 如果是单行输入框,按回车键还会使输入框失去焦点', }) public editingReturn: ComponentEventHandler[] = []; diff --git a/cocos/ui/components/graphics-component.ts b/cocos/ui/components/graphics-component.ts index 18febbc88b..154e5fb20e 100644 --- a/cocos/ui/components/graphics-component.ts +++ b/cocos/ui/components/graphics-component.ts @@ -73,6 +73,7 @@ export class GraphicsComponent extends UIRenderComponent { */ @property({ type: LineJoin, + tooltip:'两条线相交时,所创建的拐角类型', }) get lineJoin () { return this._lineJoin; @@ -93,6 +94,7 @@ export class GraphicsComponent extends UIRenderComponent { */ @property({ type: LineCap, + tooltip:'线条的结束端点样式', }) get lineCap () { return this._lineCap; @@ -111,7 +113,9 @@ export class GraphicsComponent extends UIRenderComponent { * @zh * 线段颜色。 */ - @property + @property({ + tooltip:'笔触的颜色', + }) // @constget get strokeColor (): Readonly { return this._strokeColor; @@ -130,7 +134,9 @@ export class GraphicsComponent extends UIRenderComponent { * @zh * 填充颜色。 */ - @property + @property({ + tooltip:'填充绘画的颜色', + }) // @constget get fillColor (): Readonly { return this._fillColor; @@ -149,7 +155,9 @@ export class GraphicsComponent extends UIRenderComponent { * @zh * 设置斜接面限制比例。 */ - @property + @property({ + tooltip:'最大斜接长度', + }) get miterLimit () { return this._miterLimit; } diff --git a/cocos/ui/components/label-component.ts b/cocos/ui/components/label-component.ts index 1166ac2aff..09bcb1d680 100644 --- a/cocos/ui/components/label-component.ts +++ b/cocos/ui/components/label-component.ts @@ -175,6 +175,7 @@ export class LabelComponent extends UIRenderComponent { @property({ displayOrder: 4, multiline: true, + tooltip:'Label 显示的文本内容字符串', }) get string () { return this._string; @@ -196,6 +197,7 @@ export class LabelComponent extends UIRenderComponent { @property({ type: HorizontalTextAlignment, displayOrder: 5, + tooltip:'文字水平对齐模式', }) get horizontalAlign () { return this._horizontalAlign; @@ -217,6 +219,7 @@ export class LabelComponent extends UIRenderComponent { @property({ type: VerticalTextAlignment, displayOrder: 6, + tooltip:'文字垂直对齐模式', }) get verticalAlign () { return this._verticalAlign; @@ -254,6 +257,7 @@ export class LabelComponent extends UIRenderComponent { */ @property({ displayOrder: 7, + tooltip:'文字尺寸,以 point 为单位', }) get fontSize () { return this._fontSize; @@ -274,6 +278,7 @@ export class LabelComponent extends UIRenderComponent { */ @property({ displayOrder: 8, + tooltip:'文字字体名字', }) get fontFamily () { return this._fontFamily; @@ -294,6 +299,7 @@ export class LabelComponent extends UIRenderComponent { */ @property({ displayOrder: 8, + tooltip:'文字行高,以 point 为单位', }) get lineHeight () { return this._lineHeight; @@ -314,6 +320,7 @@ export class LabelComponent extends UIRenderComponent { @property({ type: Overflow, displayOrder: 9, + tooltip:'文字排版模式,包括以下三种:\n 1. CLAMP: 节点约束框之外的文字会被截断 \n 2. SHRINK: 自动根据节点约束框缩小文字\n 3. RESIZE_HEIGHT: 根据文本内容自动更新节点的 height 属性.', }) get overflow () { return this._overflow; @@ -334,6 +341,7 @@ export class LabelComponent extends UIRenderComponent { */ @property({ displayOrder: 10, + tooltip:'自动换行', }) get enableWrapText () { return this._enableWrapText; @@ -354,6 +362,7 @@ export class LabelComponent extends UIRenderComponent { @property({ type: Font, displayOrder: 11, + tooltip:'Label 使用的字体资源', }) get font () { // return this._N$file; @@ -396,6 +405,7 @@ export class LabelComponent extends UIRenderComponent { */ @property({ displayOrder: 12, + tooltip:'是否使用系统默认字体', }) get useSystemFont () { return this._isSystemFontUsed; @@ -436,6 +446,7 @@ export class LabelComponent extends UIRenderComponent { @property({ type: CacheMode, displayOrder: 13, + tooltip:'文本缓存模式,包括以下三种:\n 1. NONE: 不做任何缓存,文本内容进行一次绘制 \n 2. BITMAP: 将文本作为静态图像加入动态图集进行批次合并,但是不能频繁动态修改文本内容 \n 3. CHAR: 将文本拆分为字符并且把字符纹理缓存到一张字符图集中进行复用,适用于字符内容重复并且频繁更新的文本内容', }) get cacheMode () { return this._cacheMode; @@ -469,6 +480,7 @@ export class LabelComponent extends UIRenderComponent { @property({ // visible: false, displayOrder: 15, + tooltip:'字体加粗', }) get isBold () { return this._isBold; @@ -490,6 +502,7 @@ export class LabelComponent extends UIRenderComponent { @property({ // visible: false, displayOrder: 16, + tooltip:'字体倾斜', }) get isItalic () { return this._isItalic; @@ -511,6 +524,7 @@ export class LabelComponent extends UIRenderComponent { @property({ // visible: false, displayOrder: 17, + tooltip:'字体加下划线', }) get isUnderline () { return this._isUnderline; diff --git a/cocos/ui/components/label-outline-component.ts b/cocos/ui/components/label-outline-component.ts index eb56b577d0..5d63bf39b4 100644 --- a/cocos/ui/components/label-outline-component.ts +++ b/cocos/ui/components/label-outline-component.ts @@ -66,7 +66,9 @@ export class LabelOutlineComponent extends Component { * outline.color = cc.color(0.5, 0.3, 0.7, 1.0); * ``` */ - @property + @property({ + tooltip:'描边的颜色', + }) // @constget get color (): Readonly { return this._color; @@ -90,7 +92,9 @@ export class LabelOutlineComponent extends Component { * outline.width = 3; * ``` */ - @property + @property({ + tooltip:'描边的宽度', + }) get width () { return this._width; } diff --git a/cocos/ui/components/layout-component.ts b/cocos/ui/components/layout-component.ts index d5a47ab875..a2ef9d99d9 100644 --- a/cocos/ui/components/layout-component.ts +++ b/cocos/ui/components/layout-component.ts @@ -171,6 +171,7 @@ export class LayoutComponent extends Component { */ @property({ type: Type, + tooltip:'自动布局模式,包括:\n 1. NONE,不会对子节点进行自动布局 \n 2. HORIZONTAL,横向自动排布子物体 \n 3. VERTICAL,垂直自动排布子物体\n 4. GRID, 采用网格方式对子物体自动进行布局', }) get type () { return this._N$layoutType; @@ -193,6 +194,7 @@ export class LayoutComponent extends Component { */ @property({ type: ResizeMode, + tooltip:'缩放模式,包括:\n 1. NONE,不会对子节点和容器进行大小缩放 \n 2. CONTAINER, 对容器的大小进行缩放 \n 3. CHILDREN, 对子节点的大小进行缩放', }) get resizeMode () { return this._resizeMode; diff --git a/cocos/ui/components/mask-component.ts b/cocos/ui/components/mask-component.ts index b7b04f7fcd..eaf5ec268e 100644 --- a/cocos/ui/components/mask-component.ts +++ b/cocos/ui/components/mask-component.ts @@ -99,6 +99,7 @@ export class MaskComponent extends UIRenderComponent { @property({ type: MaskType, displayOrder: 4, + tooltip:'遮罩类型', }) get type () { return this._type; diff --git a/cocos/ui/components/page-view-component.ts b/cocos/ui/components/page-view-component.ts index b50faac3ef..65ddf9d101 100644 --- a/cocos/ui/components/page-view-component.ts +++ b/cocos/ui/components/page-view-component.ts @@ -112,6 +112,7 @@ export class PageViewComponent extends ScrollViewComponent { */ @property({ type: SizeMode, + tooltip:'页面视图中每个页面大小类型', }) get sizeMode () { return this._sizeMode; @@ -132,6 +133,7 @@ export class PageViewComponent extends ScrollViewComponent { */ @property({ type: Direction, + tooltip:'页面视图滚动类型', }) get direction () { return this._direction; @@ -155,6 +157,7 @@ export class PageViewComponent extends ScrollViewComponent { @property({ slide: true, range: [0, 1, 0.01], + tooltip:'滚动临界值,默认单位百分比,当拖拽超出该数值时,松开会自动滚动下一页,小于时则还原', }) get scrollThreshold () { return this._scrollThreshold; @@ -175,6 +178,7 @@ export class PageViewComponent extends ScrollViewComponent { @property({ slide: true, range: [0, 1, 0.01], + tooltip:'设置 PageView PageTurning 事件的发送时机', }) get pageTurningEventTiming () { return this._pageTurningEventTiming; @@ -194,6 +198,7 @@ export class PageViewComponent extends ScrollViewComponent { */ @property({ type: PageViewIndicatorComponent, + tooltip:'页面视图指示器组件', }) get indicator () { return this._indicator; @@ -228,7 +233,9 @@ export class PageViewComponent extends ScrollViewComponent { * 当用户快速滑动时,会根据滑动开始和结束的距离与时间计算出一个速度值, * 该值与此临界值相比较,如果大于临界值,则进行自动翻页。 */ - @property + @property({ + tooltip:'快速滑动翻页临界值\n当用户快速滑动时,会根据滑动开始和结束的距离与时间计算出一个速度值\n该值与此临界值相比较,如果大于临界值,则进行自动翻页' + }) public autoPageTurningThreshold = 100; // override visible false @@ -289,6 +296,7 @@ export class PageViewComponent extends ScrollViewComponent { */ @property({ type: [ComponentEventHandler], + tooltip:'滚动视图的事件回调函数', }) public pageEvents: ComponentEventHandler[] = []; diff --git a/cocos/ui/components/page-view-indicator-component.ts b/cocos/ui/components/page-view-indicator-component.ts index b2a24b6c7d..1682ad3b7a 100644 --- a/cocos/ui/components/page-view-indicator-component.ts +++ b/cocos/ui/components/page-view-indicator-component.ts @@ -76,6 +76,7 @@ export class PageViewIndicatorComponent extends Component { */ @property({ type: SpriteFrame, + tooltip:'每个页面标记显示的图片', }) get spriteFrame () { return this._spriteFrame; @@ -96,6 +97,7 @@ export class PageViewIndicatorComponent extends Component { */ @property({ type: Direction, + tooltip:'页面标记摆放方向', }) get direction () { return this._direction; @@ -115,6 +117,7 @@ export class PageViewIndicatorComponent extends Component { */ @property({ type: Size, + tooltip:'每个页面标记的大小', }) get cellSize () { return this._cellSize; @@ -134,7 +137,9 @@ export class PageViewIndicatorComponent extends Component { * @en The distance between each element. * @zh 每个页面标记之间的边距 */ - @property + @property({ + tooltip:'每个页面标记之间的边距', + }) public spacing = 0; @property public _spriteFrame: SpriteFrame | null = null; diff --git a/cocos/ui/components/progress-bar-component.ts b/cocos/ui/components/progress-bar-component.ts index 15651fee14..6dbc7c2238 100644 --- a/cocos/ui/components/progress-bar-component.ts +++ b/cocos/ui/components/progress-bar-component.ts @@ -93,6 +93,7 @@ export class ProgressBarComponent extends Component { */ @property({ type: SpriteComponent, + tooltip:'进度条显示用的 Sprite 节点,可以动态改变尺寸', }) get barSprite () { return this._barSprite; @@ -113,6 +114,7 @@ export class ProgressBarComponent extends Component { */ @property({ type: Mode, + tooltip:'进度条显示模式,目前支持水平和垂直两种', }) get mode () { return this._mode; @@ -143,7 +145,9 @@ export class ProgressBarComponent extends Component { * @zh * 进度条实际的总长度。 */ - @property + @property({ + tooltip:'进度条在 progress 为 1 时的最大长度', + }) get totalLength () { return this._totalLength; } @@ -163,6 +167,7 @@ export class ProgressBarComponent extends Component { @property({ range: [0, 1, 0.1], slide: true, + tooltip:'当前进度指示,范围从 0 到 1', }) get progress () { return this._progress; @@ -181,7 +186,9 @@ export class ProgressBarComponent extends Component { * @zh * 进度条是否进行反方向变化。 */ - @property + @property({ + tooltip:'是否反向驱动进度条', + }) get reverse () { return this._reverse; } diff --git a/cocos/ui/components/rich-text-component.ts b/cocos/ui/components/rich-text-component.ts index 1cf134d428..80b25446c6 100644 --- a/cocos/ui/components/rich-text-component.ts +++ b/cocos/ui/components/rich-text-component.ts @@ -177,6 +177,7 @@ export class RichTextComponent extends UIComponent { */ @property({ multiline: true, + tooltip:'富文本显示的文本内容', }) get string () { return this._string; @@ -196,6 +197,7 @@ export class RichTextComponent extends UIComponent { */ @property({ type: HorizontalTextAlignment, + tooltip:'文本内容的水平对齐方式', }) get horizontalAlign () { return this._horizontalAlign; @@ -215,7 +217,9 @@ export class RichTextComponent extends UIComponent { * @zh * 富文本字体大小。 */ - @property + @property({ + tooltip:'富文本字体大小', + }) get fontSize () { return this._fontSize; } @@ -236,6 +240,7 @@ export class RichTextComponent extends UIComponent { */ @property({ type: TTFFont, + tooltip:'富文本定制字体', }) get font () { return this._font; @@ -257,7 +262,9 @@ export class RichTextComponent extends UIComponent { * @zh * 富文本的最大宽度。 */ - @property + @property({ + tooltip:'富文本的最大宽度', + }) get maxWidth () { return this._maxWidth; } @@ -276,7 +283,9 @@ export class RichTextComponent extends UIComponent { * @zh * 富文本行高。 */ - @property + @property({ + tooltip:'富文本行高', + }) get lineHeight () { return this._lineHeight; } @@ -297,6 +306,7 @@ export class RichTextComponent extends UIComponent { */ @property({ type: SpriteAtlas, + tooltip:'对于 img 标签里面的 src 属性名称,都需要在 imageAtlas 里面找到一个有效的 spriteFrame,否则 img tag 会判定为无效', }) get imageAtlas () { return this._imageAtlas; @@ -316,7 +326,9 @@ export class RichTextComponent extends UIComponent { * @zh * 选中此选项后,RichText 将阻止节点边界框中的所有输入事件(鼠标和触摸),从而防止输入事件穿透到底层节点。 */ - @property + @property({ + tooltip:'选中此选项后,RichText 将阻止节点边界框中的所有输入事件(鼠标和触摸),从而防止输入事件穿透到底层节点', + }) get handleTouchEvent () { return this._handleTouchEvent; } diff --git a/cocos/ui/components/scroll-bar-component.ts b/cocos/ui/components/scroll-bar-component.ts index 398b67f68b..ac57ed7573 100644 --- a/cocos/ui/components/scroll-bar-component.ts +++ b/cocos/ui/components/scroll-bar-component.ts @@ -80,6 +80,7 @@ export class ScrollBarComponent extends Component { */ @property({ type: SpriteComponent, + tooltip:'作为当前滚动区域位置显示的滑块 Sprite', }) get handle () { return this._handle; @@ -99,6 +100,7 @@ export class ScrollBarComponent extends Component { */ @property({ type: Direction, + tooltip:'ScrollBar 的滚动方向', }) get direction () { return this._direction; @@ -117,7 +119,9 @@ export class ScrollBarComponent extends Component { * @zh * 是否在没有滚动动作时自动隐藏 ScrollBar。 */ - @property + @property({ + tooltip:'是否在没有滚动动作时自动隐藏 ScrollBar', + }) get enableAutoHide () { return this._enableAutoHide; } @@ -138,7 +142,9 @@ export class ScrollBarComponent extends Component { * 没有滚动动作后经过多久会自动隐藏。
* 注意:只要当 “enableAutoHide” 为 true 时,才有效。 */ - @property + @property({ + tooltip:'没有滚动动作后经过多久会自动隐藏。\n注意:只要当 “enableAutoHide” 为 true 时,才有效。', + }) get autoHideTime () { return this._autoHideTime; } diff --git a/cocos/ui/components/scroll-view-component.ts b/cocos/ui/components/scroll-view-component.ts index 6f9e83050e..d3b290fef6 100644 --- a/cocos/ui/components/scroll-view-component.ts +++ b/cocos/ui/components/scroll-view-component.ts @@ -167,6 +167,7 @@ export class ScrollViewComponent extends ViewGroupComponent { */ @property({ type: Node, + tooltip:'可滚动展示内容的节点', }) get content () { return this._content; @@ -186,6 +187,7 @@ export class ScrollViewComponent extends ViewGroupComponent { */ @property({ type: ScrollBarComponent, + tooltip:'水平滚动的 ScrollBar', }) get horizontalScrollBar () { return this._horizontalScrollBar; @@ -211,6 +213,7 @@ export class ScrollViewComponent extends ViewGroupComponent { */ @property({ type: ScrollBarComponent, + tooltip:'垂直滚动的 ScrollBar', }) get verticalScrollBar () { return this._verticalScrollBar; @@ -242,21 +245,27 @@ export class ScrollViewComponent extends ViewGroupComponent { * @zh * 是否开启水平滚动。 */ - @property + @property({ + tooltip:'是否开启水平滚动', + }) public horizontal = true; /** * @zh * 是否开启垂直滚动。 */ - @property + @property({ + tooltip:'是否开启垂直滚动', + }) public vertical = true; /** * @zh * 是否开启滚动惯性。 */ - @property + @property({ + tooltip:'是否开启滚动惯性', + }) public inertia = true; /** @@ -265,6 +274,7 @@ export class ScrollViewComponent extends ViewGroupComponent { */ @property({ range: [0, 1, 0.1], + tooltip:'开启惯性后,在用户停止触摸后滚动多快停止,0 表示永不停止,1 表示立刻停止', }) public brake = 0.5; @@ -272,7 +282,9 @@ export class ScrollViewComponent extends ViewGroupComponent { * @zh * 是否允许滚动内容超过边界,并在停止触摸后回弹。 */ - @property + @property({ + tooltip:'是否允许滚动内容超过边界,并在停止触摸后回弹', + }) public elastic = true; /** @@ -281,6 +293,7 @@ export class ScrollViewComponent extends ViewGroupComponent { */ @property({ range: [0, 10], + tooltip:'回弹持续的时间,0 表示将立即反弹', }) public bounceDuration = 1; @@ -290,6 +303,7 @@ export class ScrollViewComponent extends ViewGroupComponent { */ @property({ type: [ComponentEventHandler], + tooltip:'滚动视图的事件回调函数', }) public scrollEvents: ComponentEventHandler[] = []; @@ -298,7 +312,9 @@ export class ScrollViewComponent extends ViewGroupComponent { * 如果这个属性被设置为 true,那么滚动行为会取消子节点上注册的触摸事件,默认被设置为 true。
* 注意,子节点上的 touchstart 事件仍然会触发,触点移动距离非常短的情况下 touchmove 和 touchend 也不会受影响。 */ - @property + @property({ + tooltip:'滚动行为是否会取消子节点上注册的触摸事件', + }) public cancelInnerEvents = true; protected _autoScrolling = false; diff --git a/cocos/ui/components/slider-component.ts b/cocos/ui/components/slider-component.ts index 43785bf71e..64f51613f4 100644 --- a/cocos/ui/components/slider-component.ts +++ b/cocos/ui/components/slider-component.ts @@ -72,6 +72,7 @@ export class SliderComponent extends Component { */ @property({ type: SpriteComponent, + tooltip:'滑块按钮部件', }) get handle () { return this._handle; @@ -94,6 +95,7 @@ export class SliderComponent extends Component { */ @property({ type: Direction, + tooltip:'滑动方向', }) get direction () { return this._direction; @@ -115,6 +117,7 @@ export class SliderComponent extends Component { @property({ slide: true, range: [0, 1, 0.01], + tooltip:'当前进度值,该数值的区间是 0 - 1 之间。', }) get progress () { return this._progress; @@ -137,6 +140,7 @@ export class SliderComponent extends Component { */ @property({ type: EventHandler, + tooltip:'滑动器组件事件回调函数', }) public slideEvents: EventHandler[] = []; @property diff --git a/cocos/ui/components/sprite-component.ts b/cocos/ui/components/sprite-component.ts index 2b966c0660..89627543fb 100644 --- a/cocos/ui/components/sprite-component.ts +++ b/cocos/ui/components/sprite-component.ts @@ -153,6 +153,7 @@ export class SpriteComponent extends UIRenderComponent { @property({ type: SpriteAtlas, displayOrder: 4, + tooltip:'图片资源所属的 Atlas 图集资源', }) get spriteAtlas () { return this._atlas; @@ -164,7 +165,7 @@ export class SpriteComponent extends UIRenderComponent { } this._atlas = value; - this.spriteFrame = null; +// this.spriteFrame = null; } /** @@ -174,6 +175,7 @@ export class SpriteComponent extends UIRenderComponent { @property({ type: SpriteFrame, displayOrder: 5, + tooltip:'渲染 Sprite 使用的 SpriteFrame 图片资源', }) get spriteFrame () { return this._spriteFrame; @@ -207,6 +209,9 @@ export class SpriteComponent extends UIRenderComponent { @property({ type: SpriteType, displayOrder: 6, + tooltip:'渲染模式:\n- 普通(Simple):修改尺寸会整体拉伸图像,适用于序列帧动画和普通图像 \n' + + '- 九宫格(Sliced):修改尺寸时四个角的区域不会拉伸,适用于 UI 按钮和面板背景 \n' + + '- 填充(Filled):设置一定的填充起始位置和方向,能够以一定比率剪裁显示图片', }) get type () { return this._type; @@ -229,6 +234,7 @@ export class SpriteComponent extends UIRenderComponent { */ @property({ type: FillType, + tooltip:'填充方向,可以选择横向(Horizontal),纵向(Vertical)和扇形(Radial)三种方向', }) get fillType () { return this._fillType; @@ -258,7 +264,9 @@ export class SpriteComponent extends UIRenderComponent { * sprite.fillCenter = cc.v2(0, 0); * ``` */ - @property + @property({ + tooltip:'扇形填充时,指定扇形的中心点,取值范围 0 ~ 1', + }) get fillCenter () { return this._fillCenter; } @@ -281,7 +289,8 @@ export class SpriteComponent extends UIRenderComponent { * ``` */ @property({ - range: [0, 1, 0.1] + range: [0, 1, 0.1], + tooltip:'填充起始位置,输入一个 0 ~ 1 之间的小数表示起始位置的百分比', }) get fillStart () { return this._fillStart; @@ -306,7 +315,8 @@ export class SpriteComponent extends UIRenderComponent { * ``` */ @property({ - range: [0, 1, 0.1] + range: [0, 1, 0.1], + tooltip:'填充总量,取值范围 0 ~ 1 指定显示图像范围的百分比', }) get fillRange () { return this._fillRange; @@ -329,6 +339,7 @@ export class SpriteComponent extends UIRenderComponent { */ @property({ displayOrder: 8, + tooltip:'节点约束框内是否包括透明像素区域,勾选此项会去除节点约束框内的透明区域', }) get trim () { return this._isTrimmedMode; @@ -374,6 +385,7 @@ export class SpriteComponent extends UIRenderComponent { @property({ type: SizeMode, displayOrder: 7, + tooltip:'指定 Sprite 所在节点的尺寸,CUSTOM 表示自定义尺寸,TRIMMED 表示取原始图片剪裁透明像素后的尺寸,RAW 表示取原始图片未剪裁的尺寸', }) get sizeMode () { return this._sizeMode; @@ -589,7 +601,7 @@ export class SpriteComponent extends UIRenderComponent { // this.markForRender(true); } } - +/* private _applyAtlas (spriteFrame: SpriteFrame | null) { if (!CC_EDITOR) { return; @@ -608,7 +620,7 @@ export class SpriteComponent extends UIRenderComponent { } } } - +*/ private _onTextureLoaded () { if (!this.isValid) { return; @@ -658,11 +670,12 @@ export class SpriteComponent extends UIRenderComponent { } } } - - if (CC_EDITOR) { +/* + if (CC_EDITOR&&this._atlas==null) { // Set atlas this._applyAtlas(spriteFrame); } +*/ } /** @@ -674,6 +687,24 @@ export class SpriteComponent extends UIRenderComponent { this._renderDataFlag = true; } } + + /** + * @zh + * 精灵图集内的精灵替换 + * + * @returns + */ + public changeSpriteFrameFromAtlas (name:string) { + if(this._atlas){ + const sprite = this._atlas!.getSpriteFrame(name); + this._markForUpdateUvDirty(); + this._spriteFrame=sprite; + this.markForUpdateRenderData(true); + }else{ + return; + } + } + } cc.SpriteComponent = SpriteComponent; diff --git a/cocos/ui/components/toggle-component.ts b/cocos/ui/components/toggle-component.ts index 4aa463e462..ed964d570c 100644 --- a/cocos/ui/components/toggle-component.ts +++ b/cocos/ui/components/toggle-component.ts @@ -48,7 +48,9 @@ export class ToggleComponent extends ButtonComponent { * @zh * 如果这个设置为 true,则 check mark 组件会处于 enabled 状态,否则处于 disabled 状态。 */ - @property + @property({ + tooltip:'如果这个设置为 true,则 check mark 组件会处于 enabled 状态,否则处于 disabled 状态。', + }) get isChecked () { return this._isChecked; } @@ -68,6 +70,7 @@ export class ToggleComponent extends ButtonComponent { */ @property({ type: ToggleContainerComponent, + tooltip:'Toggle 所属的 ToggleGroup,这个属性是可选的。如果这个属性为 null,则 Toggle 是一个 CheckBox,否则,Toggle 是一个 RadioButton。' }) get toggleGroup () { return this._toggleGroup; @@ -93,6 +96,7 @@ export class ToggleComponent extends ButtonComponent { */ @property({ type: SpriteComponent, + tooltip:'Toggle 处于选中状态时显示的精灵图片', }) get checkMark () { return this._checkMark; @@ -126,6 +130,7 @@ export class ToggleComponent extends ButtonComponent { */ @property({ type: [ComponentEventHandler], + tooltip:'列表类型,默认为空,用户添加的每一个事件由节点引用,组件名称和一个响应函数组成', }) public checkEvents: ComponentEventHandler[] = []; @property diff --git a/cocos/ui/components/toggle-container-component.ts b/cocos/ui/components/toggle-container-component.ts index 349e7c1cc1..99ab52c538 100644 --- a/cocos/ui/components/toggle-container-component.ts +++ b/cocos/ui/components/toggle-container-component.ts @@ -46,6 +46,7 @@ import { ToggleComponent} from './toggle-component'; export class ToggleContainerComponent extends Component { @property({ type: [ComponentEventHandler], + tooltip:'选中事件。列表类型,默认为空,用户添加的每一个事件由节点引用,组件名称和一个响应函数组成。', }) public checkEvents: ComponentEventHandler[] = []; @property @@ -56,7 +57,9 @@ export class ToggleContainerComponent extends Component { * @zh * 如果这个设置为 true,那么 toggle 按钮在被点击的时候可以反复地被选中和未选中。 */ - @property + @property({ + tooltip:'如果这个设置为 true, 那么 toggle 按钮在被点击的时候可以反复地被选中和未选中。', + }) get allowSwitchOff () { return this._allowSwitchOff; } diff --git a/cocos/ui/components/webview/webView-component.ts b/cocos/ui/components/webview/webView-component.ts index b89573503a..34fadee10e 100644 --- a/cocos/ui/components/webview/webView-component.ts +++ b/cocos/ui/components/webview/webView-component.ts @@ -77,7 +77,9 @@ export class WebviewComponent extends UIComponent { * @zh * 指定 WebView 加载的网址,它应该是一个 http 或者 https 开头的字符串。 */ - @property + @property({ + tooltip:'指定 WebView 加载的网址,它应该是一个 http 或者 https 开头的字符串', + }) get url () { return this._url; } @@ -100,6 +102,7 @@ export class WebviewComponent extends UIComponent { */ @property({ type: EventHandler, + tooltip:'WebView 的回调事件,当网页加载过程中,加载完成后或者加载出错时都会回调此函数', }) public webviewEvents: EventHandler[] = []; diff --git a/cocos/ui/components/widget-component.ts b/cocos/ui/components/widget-component.ts index ceffb82718..05925ccd75 100644 --- a/cocos/ui/components/widget-component.ts +++ b/cocos/ui/components/widget-component.ts @@ -192,6 +192,7 @@ export class WidgetComponent extends Component { */ @property({ type: Node, + tooltip:'对齐目标', }) get target () { return this._target; @@ -219,7 +220,9 @@ export class WidgetComponent extends Component { * @zh * 是否对齐上边。 */ - @property + @property({ + tooltip:'是否对齐上边', + }) get isAlignTop () { return (this._alignFlags & AlignFlags.TOP) > 0; } @@ -232,7 +235,9 @@ export class WidgetComponent extends Component { * @zh * 是否对齐下边。 */ - @property + @property({ + tooltip:'是否对齐下边', + }) get isAlignBottom () { return (this._alignFlags & AlignFlags.BOT) > 0; } @@ -245,7 +250,9 @@ export class WidgetComponent extends Component { * @zh * 是否对齐左边。 */ - @property + @property({ + tooltip:'是否对齐左边', + }) get isAlignLeft () { return (this._alignFlags & AlignFlags.LEFT) > 0; } @@ -258,7 +265,9 @@ export class WidgetComponent extends Component { * @zh * 是否对齐右边。 */ - @property + @property({ + tooltip:'是否对齐右边', + }) get isAlignRight () { return (this._alignFlags & AlignFlags.RIGHT) > 0; } @@ -271,7 +280,9 @@ export class WidgetComponent extends Component { * @zh * 是否垂直方向对齐中点,开启此项会将垂直方向其他对齐选项取消。 */ - @property + @property({ + tooltip:'是否垂直方向对齐中点,开启此项会将垂直方向其他对齐选项取消', + }) get isAlignVerticalCenter () { return (this._alignFlags & AlignFlags.MID) > 0; } @@ -291,7 +302,9 @@ export class WidgetComponent extends Component { * @zh * 是否水平方向对齐中点,开启此选项会将水平方向其他对齐选项取消。 */ - @property + @property({ + tooltip:'是否水平方向对齐中点,开启此选项会将水平方向其他对齐选项取消', + }) get isAlignHorizontalCenter () { return (this._alignFlags & AlignFlags.CENTER) > 0; } @@ -553,6 +566,7 @@ export class WidgetComponent extends Component { */ @property({ type: AlignMode, + tooltip:'指定 widget 的对齐方式,用于决定运行时 widget 应何时更新', }) get alignMode () { return this._alignMode;