Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more feature cropping settings for RichText, Mask, Graphics, UISkew, AffineTransform. #18284

Open
wants to merge 5 commits into
base: v3.8.6
Choose a base branch
from

Conversation

dumganhar
Copy link
Contributor

@dumganhar dumganhar commented Feb 6, 2025

Re: #18222

New settings:

WeChat3fded8d85a32ce7ce9cf9c2d652b9fb5

Changelog


Continuous Integration

This pull request:

  • needs automatic test cases check.

    Manual trigger with @cocos-robot run test cases afterward.

  • does not change any runtime related code or build configuration

    If any reviewer thinks the CI checks are needed, please uncheck this option, then close and reopen the issue.


Compatibility Check

This pull request:

  • changes public API, and have ensured backward compatibility with deprecated features.
  • affects platform compatibility, e.g. system version, browser version, platform sdk version, platform toolchain, language version, hardware compatibility etc.
  • affects file structure of the build package or build configuration which requires user project upgrade.
  • introduces breaking changes, please list all changes, affected features and the scope of violation.

@dumganhar dumganhar requested a review from minggo February 6, 2025 10:35
Copy link

github-actions bot commented Feb 6, 2025

⚠️ Package size ⤴ 12 bytes, old: 5193072, new: 5193084

Interface Check Report

! WARNING this pull request has changed these public interfaces:

@@ -569,9 +569,8 @@
         getStencilHash(stage: __private._cocos_2d_renderer_stencil_manager__Stage): number;
     }
     export const spriteAssembler: IAssemblerManager;
     export const labelAssembler: IAssemblerManager;
-    export const graphicsAssembler: IAssemblerManager;
     /**
      * @en
      * Class for sprite atlas handling.
      * @zh
@@ -1756,64 +1755,8 @@
         getComputeAABB(out?: geometry.AABB): geometry.AABB;
         protected _selfBoundingBox(out: math.Rect): math.Rect;
         protected _parentChanged(node: Node): void;
     }
-    export class UISkew extends Component {
-        constructor();
-        protected __preload(): void;
-        protected onEnable(): void;
-        protected onDisable(): void;
-        protected onDestroy(): void;
-        /**
-         * @en Gets the skew on x axis. Unit is degree.
-         * @zh 获取 X 轴斜切角度。
-         */
-        get x(): number;
-        /**
-         * @en Sets the skew on x axis. Unit is degree.
-         * @zh 设置 X 轴斜切角度。
-         */
-        set x(v: number);
-        /**
-         * @en Gets the skew on y axis. Unit is degree.
-         * @zh 获取 Y 轴斜切角度。
-         */
-        get y(): number;
-        /**
-         * @en Sets the skew on y axis. Unit is degree.
-         * @zh 设置 Y 轴斜切角度。
-         */
-        set y(v: number);
-        /**
-         * @en Gets the skew value of the node. Unit is degree.
-         * @zh 获取节点斜切角度。
-         */
-        get skew(): Readonly<math.Vec2>;
-        /**
-         * @en Sets the skew value of the node. Unit is degree.
-         * @zh 设置节点斜切角度。
-         */
-        set skew(value: Readonly<math.Vec2>);
-        /**
-         * @en Sets the skew value of the node by Vec2.
-         * @zh 设置节点斜切角度。
-         * @param @en value The skew value in Vec2. @zh 斜切角度值。
-         */
-        setSkew(value: Readonly<math.IVec2Like>): void;
-        /**
-         * @en Sets the skew value of the node by x and y.
-         * @zh 设置节点斜切角度。
-         * @param x @en The skew on x axis. @zh X 轴斜切角度。
-         * @param y @en The skew on y axis. @zh Y 轴斜切角度。
-         */
-        setSkew(x: number, y: number): void;
-        /**
-         * @en Copies and returns the skew value of the node.
-         * @zh 拷贝节点斜切角度值并返回。
-         * @returns @en The skew value of the node. @zh 节点斜切角度。
-         */
-        getSkew(out?: math.Vec2): math.Vec2;
-    }
     /**
      * @en The entry node for 2D object data collection, all 2D rendering objects need to be rendered under the RenderRoot node.
      * @zh 2D 对象数据收集的入口节点,所有的 2D渲染对象需在 RenderRoot 节点下才可以被渲染。
      */
@@ -1859,401 +1802,8 @@
         protected _attachToScene(): void;
     }
     /**
      * @en
-     * The Mask Component.
-     *
-     * @zh
-     * 遮罩组件。
-     */
-    export class Mask extends Component {
-        /**
-         * @en The type for mask.
-         *
-         * @zh 遮罩组件类型。
-         */
-        static Type: typeof __private._cocos_2d_components_mask__MaskType;
-        constructor();
-        /**
-         * @en
-         * The mask type.
-         *
-         * @zh
-         * 遮罩类型。
-         */
-        get type(): __private._cocos_2d_components_mask__MaskType;
-        set type(value: __private._cocos_2d_components_mask__MaskType);
-        /**
-         * @en
-         * Reverse mask.
-         * @zh
-         * 反向遮罩。
-         */
-        get inverted(): boolean;
-        set inverted(value: boolean);
-        /**
-         * @en
-         * The segments for ellipse mask.
-         *
-         * TODO: remove segments, not supported by graphics
-         * @zh
-         * 椭圆遮罩的曲线细分数。
-         */
-        get segments(): number;
-        set segments(value: number);
-        /**
-         * @en
-         * The mask image.
-         *
-         * @zh
-         * 遮罩所需要的贴图。
-         * @deprecated since v3.6.1
-         */
-        get spriteFrame(): SpriteFrame | null;
-        set spriteFrame(value: SpriteFrame | null);
-        /**
-         * @en
-         * The alpha threshold.(Not supported Canvas Mode) <br/>
-         * The content is drawn only where the stencil have pixel with alpha greater than the alphaThreshold. <br/>
-         * Should be a float between 0 and 1. <br/>
-         * This default to 0.1.
-         * When it's set to 1, the stencil will discard all pixels, nothing will be shown.
-         * @zh
-         * Alpha 阈值(不支持 Canvas 模式)<br/>
-         * 只有当模板的像素的 alpha 大于等于 alphaThreshold 时,才会绘制内容。<br/>
-         * 该数值 0 ~ 1 之间的浮点数,默认值为 0.1
-         * 当被设置为 1 时,会丢弃所有蒙版像素,所以不会显示任何内容
-         */
-        get alphaThreshold(): number;
-        set alphaThreshold(value: number);
-        /**
-         * @en Rendering component for providing stencil buffer information.
-         * @zh 用于提供 stencil buffer 信息的渲染组件。
-         */
-        get subComp(): Sprite | Graphics | null;
-        protected _type: __private._cocos_2d_components_mask__MaskType;
-        protected _inverted: boolean;
-        protected _segments: number;
-        protected _alphaThreshold: number;
-        protected _sprite: Sprite | null;
-        protected _graphics: Graphics | null;
-        protected _stencilStage: __private._cocos_2d_renderer_stencil_manager__Stage;
-        onLoad(): void;
-        onEnable(): void;
-        onRestore(): void;
-        onDisable(): void;
-        onDestroy(): void;
-        /**
-         * @en Hit test with point in World Space.
-         * @zh 世界空间中的点击测试。
-         * @param worldPt @en point in World Space. @zh 世界空间中的点击点。
-         */
-        isHit(worldPt: math.Vec2): boolean;
-        protected _nodeStateChange(type: TransformBit): void;
-        protected _createSprite(): void;
-        protected _createGraphics(): void;
-        protected _updateGraphics(): void;
-        protected _enableRender(): void;
-        protected _disableRender(): void;
-        protected _removeMaskNode(): void;
-        /**
-         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
-         * you can directly manipulate the rendering components under the same node to complete the operation
-         */
-        get customMaterial(): Material | null;
-        set customMaterial(val: Material | null);
-        /**
-         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
-         * you can directly manipulate the rendering components under the same node to complete the operation
-         */
-        get color(): math.Color | null;
-        set color(value: math.Color | null);
-        /**
-         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
-         * you can directly manipulate the rendering components under the same node to complete the operation
-         */
-        markForUpdateRenderData(enable?: boolean): void;
-        /**
-         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
-         * you can directly manipulate the rendering components under the same node to complete the operation
-         */
-        requestRenderData(any: any): void;
-        /**
-         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
-         * you can directly manipulate the rendering components under the same node to complete the operation
-         */
-        destroyRenderData(): void;
-        /**
-         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
-         * you can directly manipulate the rendering components under the same node to complete the operation
-         */
-        updateRenderer(): void;
-        /**
-         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
-         * you can directly manipulate the rendering components under the same node to complete the operation
-         */
-        fillBuffers(render: any): void;
-        /**
-         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
-         * you can directly manipulate the rendering components under the same node to complete the operation
-         */
-        postUpdateAssembler(render: any): void;
-        /**
-         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
-         * you can directly manipulate the rendering components under the same node to complete the operation
-         */
-        setNodeDirty(): void;
-        /**
-         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
-         * you can directly manipulate the rendering components under the same node to complete the operation
-         */
-        setTextureDirty(): void;
-        /**
-         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
-         * you can directly manipulate the rendering components under the same node to complete the operation
-         */
-        get sharedMaterial(): Material | null;
-        /**
-         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
-         * you can directly manipulate the rendering components under the same node to complete the operation
-         */
-        get sharedMaterials(): (Material | null)[] | null;
-        set sharedMaterials(val: (Material | null)[] | null);
-        /**
-         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
-         * you can directly manipulate the rendering components under the same node to complete the operation
-         */
-        get material(): any;
-        set material(val: any);
-        /**
-         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
-         * you can directly manipulate the rendering components under the same node to complete the operation
-         */
-        get materials(): (any)[];
-        set materials(val: (any)[]);
-        /**
-         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
-         * you can directly manipulate the rendering components under the same node to complete the operation
-         */
-        getMaterial(idx: number): any;
-        /**
-         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
-         * you can directly manipulate the rendering components under the same node to complete the operation
-         */
-        setMaterial(material: Material | renderer.MaterialInstance | null, index: number): void;
-        /**
-         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
-         * you can directly manipulate the rendering components under the same node to complete the operation
-         */
-        getMaterialInstance(idx: number): any;
-        /**
-         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
-         * you can directly manipulate the rendering components under the same node to complete the operation
-         */
-        setMaterialInstance(matInst: Material | renderer.MaterialInstance | null, index: number): void;
-        /**
-         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
-         * you can directly manipulate the rendering components under the same node to complete the operation
-         */
-        getRenderMaterial(index: number): any;
-    }
-    /**
-     * @en
-     * The RichText Component.
-     *
-     * @zh
-     * 富文本组件。
-     */
-    export class RichText extends Component {
-        /**
-         * @en
-         * Content string of RichText.
-         *
-         * @zh
-         * 富文本显示的文本内容。
-         */
-        get string(): string;
-        set string(value: string);
-        /**
-         * @en
-         * Horizontal Alignment of each line in RichText.
-         *
-         * @zh
-         * 文本内容的水平对齐方式。
-         */
-        get horizontalAlign(): HorizontalTextAlignment;
-        set horizontalAlign(value: HorizontalTextAlignment);
-        /**
-         * @en
-         * Vertical Alignment of each line in RichText.
-         *
-         * @zh
-         * 文本内容的竖直对齐方式。
-         */
-        get verticalAlign(): VerticalTextAlignment;
-        set verticalAlign(value: VerticalTextAlignment);
-        /**
-         * @en
-         * Font size of RichText.
-         *
-         * @zh
-         * 富文本字体大小。
-         */
-        get fontSize(): number;
-        set fontSize(value: number);
-        /**
-         * @en
-         * Font color of RichText. Works when the text content does not have a color parameter set. Transparency cascade is not supported.
-         *
-         * @zh
-         * 富文本默认文字颜色。在文本内容没有设置颜色参数时生效。暂不支持颜色级联。
-         */
-        get fontColor(): math.Color;
-        set fontColor(value: math.Color);
-        /**
-         * @en
-         * Custom System font of RichText.
-         *
-         * @zh
-         * 富文本定制系统字体。
-         */
-        get fontFamily(): string;
-        set fontFamily(value: string);
-        /**
-         * @en
-         * Custom System font of RichText.
-         *
-         * @zh
-         * 富文本定制字体。
-         */
-        get font(): TTFFont | null;
-        set font(value: TTFFont | null);
-        /**
-         * @en
-         * Whether to use system font name or not.
-         *
-         * @zh
-         * 是否使用系统字体。
-         */
-        get useSystemFont(): boolean;
-        set useSystemFont(value: boolean);
-        /**
-         * @en
-         * The cache mode of label. This mode only supports system fonts.
-         *
-         * @zh
-         * 文本缓存模式, 该模式只支持系统字体。
-         */
-        get cacheMode(): CacheMode;
-        set cacheMode(value: CacheMode);
-        /**
-         * @en
-         * The maximize width of the RichText.
-         *
-         * @zh
-         * 富文本的最大宽度。
-         */
-        get maxWidth(): number;
-        set maxWidth(value: number);
-        /**
-         * @en
-         * Line Height of RichText.
-         *
-         * @zh
-         * 富文本行高。
-         */
-        get lineHeight(): number;
-        set lineHeight(value: number);
-        /**
-         * @en
-         * The image atlas for the img tag. For each src value in the img tag, there should be a valid spriteFrame in the image atlas.
-         *
-         * @zh
-         * 对于 img 标签里面的 src 属性名称,都需要在 imageAtlas 里面找到一个有效的 spriteFrame,否则 img tag 会判定为无效。
-         */
-        get imageAtlas(): SpriteAtlas | null;
-        set imageAtlas(value: SpriteAtlas | null);
-        /**
-         * @en
-         * Once checked, the RichText will block all input events (mouse and touch) within
-         * the bounding box of the node, preventing the input from penetrating into the underlying node.
-         *
-         * @zh
-         * 选中此选项后,RichText 将阻止节点边界框中的所有输入事件(鼠标和触摸),从而防止输入事件穿透到底层节点。
-         */
-        get handleTouchEvent(): boolean;
-        set handleTouchEvent(value: boolean);
-        /**
-         * @en Enum for horizontal text alignment.
-         *
-         * @zh 文本横向对齐类型。
-         */
-        static HorizontalAlign: typeof HorizontalTextAlignment;
-        /**
-         * @en Enum for vertical text alignment.
-         *
-         * @zh 文本垂直对齐类型。
-         */
-        static VerticalAlign: typeof VerticalTextAlignment;
-        protected _lineHeight: number;
-        protected _string: string;
-        protected _horizontalAlign: HorizontalTextAlignment;
-        protected _verticalAlign: VerticalTextAlignment;
-        protected _fontSize: number;
-        protected _fontColor: math.Color;
-        protected _maxWidth: number;
-        protected _fontFamily: string;
-        protected _font: TTFFont | null;
-        protected _isSystemFontUsed: boolean;
-        protected _userDefinedFont: TTFFont | null;
-        protected _cacheMode: CacheMode;
-        protected _imageAtlas: SpriteAtlas | null;
-        protected _handleTouchEvent: boolean;
-        protected _textArray: IHtmlTextParserResultObj[];
-        protected _segments: __private._cocos_2d_components_rich_text__ISegment[];
-        protected _labelSegmentsCache: __private._cocos_2d_components_rich_text__ISegment[];
-        protected _linesWidth: number[];
-        protected _lineCount: number;
-        protected _labelWidth: number;
-        protected _labelHeight: number;
-        protected _layoutDirty: boolean;
-        protected _lineOffsetX: number;
-        protected _updateRichTextStatus: () => void;
-        protected _labelChildrenNum: number;
-        constructor();
-        onLoad(): void;
-        onEnable(): void;
-        onDisable(): void;
-        onRestore(): void;
-        onDestroy(): void;
-        protected _addEventListeners(): void;
-        protected _removeEventListeners(): void;
-        protected _updateLabelSegmentTextAttributes(): void;
-        protected _createFontLabel(str: string): __private._cocos_2d_components_rich_text__ISegment;
-        protected _createImage(spriteFrame: SpriteFrame): __private._cocos_2d_components_rich_text__ISegment;
-        protected _onTTFLoaded(): void;
-        protected _measureText(styleIndex: number, string?: string): number | ((s: string) => number);
-        protected _onTouchEnded(event: EventTouch): void;
-        protected _containsTouchLocation(label: __private._cocos_2d_components_rich_text__ISegment, point: math.Vec2): boolean;
-        protected _resetState(): void;
-        protected _activateChildren(active: any): void;
-        protected _addLabelSegment(stringToken: string, styleIndex: number): __private._cocos_2d_components_rich_text__ISegment;
-        protected _updateRichTextWithMaxWidth(labelString: string, labelWidth: number, styleIndex: number): void;
-        protected _isLastComponentCR(stringToken: any): boolean;
-        protected _updateLineInfo(): void;
-        protected _needsUpdateTextLayout(newTextArray: IHtmlTextParserResultObj[]): boolean;
-        protected _addRichTextImageElement(richTextElement: IHtmlTextParserResultObj): void;
-        protected _updateTextDefaultColor(): void;
-        protected _updateRichText(): void;
-        protected _getFirstWordLen(text: string, startIndex: number, textLen: number): number;
-        protected _updateRichTextPosition(): void;
-        protected _convertLiteralColorValue(color: string): math.Color;
-        protected _applyTextAttribute(labelSeg: __private._cocos_2d_components_rich_text__ISegment): void;
-        protected _applyLayer(): void;
-        protected _resetLabelState(label: Label): void;
-    }
-    /**
-     * @en
      * Renders a sprite in the scene.
      *
      * @zh
      * 渲染精灵组件。
@@ -2565,315 +2115,8 @@
         onDisable(): void;
     }
     /**
      * @en
-     * Graphics component.
-     *
-     * @zh
-     * 自定义图形类。
-     */
-    export class Graphics extends UIRenderer {
-        /**
-         * @en
-         * Current line width.
-         *
-         * @zh
-         * 当前线条宽度。
-         */
-        get lineWidth(): number;
-        set lineWidth(value: number);
-        /**
-         * @en
-         * Determines how two connecting segments (of lines, arcs or curves) with non-zero lengths in a shape are joined together.
-         *
-         * @zh
-         * 用来设置2个长度不为0的相连部分(线段,圆弧,曲线)如何连接在一起的属性。
-         */
-        get lineJoin(): __private._cocos_2d_assembler_graphics_types__LineJoin;
-        set lineJoin(value: __private._cocos_2d_assembler_graphics_types__LineJoin);
-        /**
-         * @en
-         * Determines how the end points of every line are drawn.
-         *
-         * @zh
-         * 指定如何绘制每一条线段末端。
-         */
-        get lineCap(): __private._cocos_2d_assembler_graphics_types__LineCap;
-        set lineCap(value: __private._cocos_2d_assembler_graphics_types__LineCap);
-        /**
-         * @en
-         * Brush stroke color.
-         *
-         * @zh
-         * 笔触的颜色。
-         */
-        get strokeColor(): Readonly<math.Color>;
-        set strokeColor(value: Readonly<math.Color>);
-        /**
-         * @en
-         * Fill paint color.
-         *
-         * @zh
-         * 填充绘画的颜色。
-         */
-        get fillColor(): Readonly<math.Color>;
-        set fillColor(value: Readonly<math.Color>);
-        /**
-         * @en
-         * Set the miter limit ratio.
-         *
-         * @zh
-         * 设置斜接面限制比例。
-         */
-        get miterLimit(): number;
-        set miterLimit(value: number);
-        get color(): math.Color;
-        set color(value: math.Color);
-        static LineJoin: typeof __private._cocos_2d_assembler_graphics_types__LineJoin;
-        static LineCap: typeof __private._cocos_2d_assembler_graphics_types__LineCap;
-        impl: __private._cocos_2d_assembler_graphics_webgl_impl__Impl | null;
-        /**
-         * @deprecated since v3.6.0, this is an engine private interface that will be removed in the future.
-         */
-        model: renderer.scene.Model | null;
-        protected _lineWidth: number;
-        protected _strokeColor: math.Color;
-        protected _lineJoin: __private._cocos_2d_assembler_graphics_types__LineJoin;
-        protected _lineCap: __private._cocos_2d_assembler_graphics_types__LineCap;
-        protected _fillColor: math.Color;
-        protected _miterLimit: number;
-        protected _isDrawing: boolean;
-        protected _isNeedUploadData: boolean;
-        protected _graphicsNativeProxy: __private._cocos_2d_renderer_native_2d__NativeUIModelProxy;
-        /**
-         * @deprecated since v3.7.0, this is an engine private interface that will be removed in the future.
-         */
-        get graphicsNativeProxy(): __private._cocos_2d_renderer_native_2d__NativeUIModelProxy;
-        constructor();
-        onRestore(): void;
-        onLoad(): void;
-        onEnable(): void;
-        onDestroy(): void;
-        /**
-         * @en
-         * Move path start point to (x,y).
-         *
-         * @zh
-         * 移动路径起点到坐标(x, y)。
-         *
-         * @param x @en The x-axis coordinate of the target position.
-         *          @zh 目标位置的 X 轴坐标。
-         * @param y @en The y-axis coordinate of the target position.
-         *          @zh 目标位置的 y 轴坐标。
-         */
-        moveTo(x: number, y: number): void;
-        /**
-         * @en
-         * Adds a straight line to the path.
-         *
-         * @zh
-         * 绘制直线路径。
-         *
-         * @param x @en The x-axis coordinate of the target position.
-         *          @zh 目标位置的 x 轴坐标。
-         * @param y @en The x-axis coordinate of the target position.
-         *          @zh 目标位置的 y 轴坐标。
-         */
-        lineTo(x: number, y: number): void;
-        /**
-         * @en
-         * Adds a cubic Bézier curve to the path.
-         *
-         * @zh
-         * 绘制三次贝赛尔曲线路径。
-         *
-         * @param c1x @en The x-axis coordinate of the first control point.
-         *            @zh 第一个控制点的 x 轴坐标。
-         * @param c1y @en The y-axis coordinate of the first control point.
-         *            @zh 第一个控制点的 y 轴坐标。
-         * @param c2x @en The x-axis coordinate of the second control point.
-         *            @zh 第二个控制点的 x 轴坐标。
-         * @param c2y @en The y-axis coordinate of the second control point.
-         *            @zh 第二个控制点的 y 轴坐标。
-         * @param x @en The x-axis coordinate of the last control point.
-         *          @zh 最后一个控制点的 x 轴坐标。
-         * @param y @en The y-axis coordinate of the last control point.
-         *          @zh 最后一个控制点的 y 轴坐标。
-         */
-        bezierCurveTo(c1x: number, c1y: number, c2x: number, c2y: number, x: number, y: number): void;
-        /**
-         * @en
-         * Adds a quadratic Bézier curve to the path.
-         *
-         * @zh
-         * 绘制二次贝赛尔曲线路径。
-         *
-         * @param cx @en The x-axis coordinate of the starting control point.
-         *           @zh 起始控制点的 x 轴坐标。
-         * @param cy @en The y-axis coordinate of the starting control point.
-         *           @zh 起始控制点的 y 轴坐标。
-         * @param x @en The x-axis coordinates of the endpoint control point.
-         *          @zh 终点控制点的 x 轴坐标。
-         * @param y @en The y-axis coordinates of the endpoint control point.
-         *          @zh 终点控制点的 x 轴坐标。
-         */
-        quadraticCurveTo(cx: number, cy: number, x: number, y: number): void;
-        /**
-         * @en
-         * Adds an arc to the path which is centered at (cx, cy) position with radius r starting at startAngle
-         * and ending at endAngle going in the given direction by counterclockwise (defaulting to false).
-         *
-         * @zh
-         * 绘制圆弧路径。圆弧路径的圆心在 (cx, cy) 位置,半径为 r ,根据 counterclockwise (默认为false)指定的方向从 startAngle 开始绘制,到 endAngle 结束。
-         *
-         * @param cx @en The coordinate x-axis of the central control point.
-         *           @zh 中心控制点的坐标 x 轴。
-         * @param cy @en The coordinate y-axis of the central control point.
-         *           @zh 中心控制点的坐标 y 轴。
-         * @param r @en Angle in Radian.
-         *          @zh 圆弧弧度。
-         * @param startAngle @en The starting angle in radian, measured clockwise from the positive x-axis.
-         *                   @zh 弧度起点,从正 x 轴顺时针方向测量。
-         * @param endAngle @en The ending angle in radian, measured clockwise from the positive x-axis.
-         *                 @zh 弧度终点,从正 x 轴顺时针方向测量。
-         * @param counterclockwise @en If true, draws counterclockwise between the two angles. Default is clockwise.
-         *                         @zh 如果为真,在两个角度之间逆时针绘制。默认顺时针。
-         */
-        arc(cx: number, cy: number, r: number, startAngle: number, endAngle: number, counterclockwise: boolean): void;
-        /**
-         * @en
-         * Adds an ellipse to the path.
-         *
-         * @zh
-         * 绘制椭圆路径。
-         *
-         * @param cx @en The x-axis coordinates of the center point.
-         *           @zh 中心点的 x 轴坐标。
-         * @param cy @en The y-axis coordinates of the center point.
-         *           @zh 中心点的 y 轴坐标。
-         * @param rx @en The radius of the x-axis of the ellipse.
-         *           @zh 椭圆 x 轴半径。
-         * @param ry @en The radius of the y-axis of the ellipse.
-         *           @zh 椭圆 y 轴半径。
-         */
-        ellipse(cx: number, cy: number, rx: number, ry: number): void;
-        /**
-         * @en
-         * Adds a circle to the path.
-         *
-         * @zh
-         * 绘制圆形路径。
-         *
-         * @param cx @en The x-axis coordinates of the center point.
-         *           @zh 中心点的 x 轴坐标。
-         * @param cy @en The y-axis coordinates of the center point.
-         *           @zh 中心点的 y 轴坐标。
-         * @param r @en Radius.
-         *          @zh 圆半径。
-         */
-        circle(cx: number, cy: number, r: number): void;
-        /**
-         * @en
-         * Adds a rectangle to the path.
-         *
-         * @zh
-         * 绘制矩形路径。
-         *
-         * @param x @en The x-axis coordinate of the top left point of the rectangle.
-         *          @zh 矩形起始 x 轴坐标。
-         * @param y @en The y-axis coordinate of the top left point of the rectangle.
-         *          @zh 矩形起始 y 轴坐标。
-         * @param w @en The width of the rectangle.
-         *          @zh 矩形宽度。
-         * @param h @en The height of the rectangle.
-         *          @zh 矩形高度。
-         */
-        rect(x: number, y: number, w: number, h: number): void;
-        /**
-         * @en
-         * Adds a round corner rectangle to the path.
-         *
-         * @zh
-         * 绘制圆角矩形路径。
-         *
-         * @param x @en The x-axis coordinate of the top left point of the rectangle.
-         *          @zh 矩形起始 x 轴坐标。
-         * @param y @en The y-axis coordinate of the top left point of the rectangle.
-         *          @zh 矩形起始 y 轴坐标。
-         * @param w @en The width of the rectangle.
-         *          @zh 矩形宽度。
-         * @param h @en The height of the rectangle.
-         *          @zh 矩形高度。
-         * @param r @en Radius of rectangular rounded corners.
-         *          @zh 矩形圆角半径。
-         */
-        roundRect(x: number, y: number, w: number, h: number, r: number): void;
-        /**
-         * @en
-         * Draws a filled rectangle.
-         *
-         * @zh
-         * 绘制填充矩形。
-         *
-         * @param x @en The x-axis coordinate of the top left point of the rectangle.
-         *          @zh 矩形起始 x 轴坐标。
-         * @param y @en The y-axis coordinate of the top left point of the rectangle.
-         *          @zh 矩形起始 y 轴坐标。
-         * @param w @en The width of the rectangle.
-         *          @zh 矩形宽度。
-         * @param h @en The height of the rectangle.
-         *          @zh 矩形高度。
-         */
-        fillRect(x: number, y: number, w: number, h: number): void;
-        /**
-         * @en
-         * Erasing any previously drawn content.
-         *
-         * @zh
-         * 擦除之前绘制的所有内容的方法。
-         */
-        clear(): void;
-        /**
-         * @en
-         * Causes the point of the pen to move back to the start of the current path.
-         * It tries to add a straight line from the current point to the start.
-         *
-         * @zh
-         * 将笔点返回到当前路径起始点的。它尝试从当前点到起始点绘制一条直线。
-         */
-        close(): void;
-        /**
-         * @en
-         * Strokes the current or given path with the current stroke style.
-         *
-         * @zh
-         * 根据当前的画线样式,绘制当前或已经存在的路径。
-         */
-        stroke(): void;
-        /**
-         * @en
-         * Fills the current or given path with the current fill style.
-         *
-         * @zh
-         * 根据当前的画线样式,填充当前或已经存在的路径。
-         */
-        fill(): void;
-        /**
-         * @deprecated since v3.7.0, this is an engine private interface that will be removed in the future.
-         */
-        activeSubModel(idx: number): void;
-        protected _uploadData(): void;
-        protected _render(render: __private._cocos_2d_renderer_i_batcher__IBatcher): void;
-        protected _flushAssembler(): void;
-        protected _canRender(): boolean;
-        /**
-         * @deprecated since v3.7.0, this is an engine private interface that will be removed in the future.
-         */
-        updateRenderer(): void;
-        protected createRenderEntity(): __private._cocos_2d_renderer_render_entity__RenderEntity;
-    }
-    /**
-     * @en
      * Static batch component of UI.
      * This component is placed on the root node of all node objects that need to be batch.
      * Only sprites and label participate in the batch.
      * Static batch must be enabled manually, otherwise dynamic batch is still used.
@@ -3427,8 +2670,708 @@
         protected _applyFontTexture(): void;
         protected changeMaterialForDefine(): void;
     }
     /**
+     * @en
+     * The Mask Component.
+     *
+     * @zh
+     * 遮罩组件。
+     */
+    export class MaskComponent extends Component {
+        /**
+         * @en The type for mask.
+         *
+         * @zh 遮罩组件类型。
+         */
+        static Type: typeof MaskType;
+        constructor();
+        /**
+         * @en
+         * The mask type.
+         *
+         * @zh
+         * 遮罩类型。
+         */
+        get type(): MaskType;
+        set type(value: MaskType);
+        /**
+         * @en
+         * Reverse mask.
+         * @zh
+         * 反向遮罩。
+         */
+        get inverted(): boolean;
+        set inverted(value: boolean);
+        /**
+         * @en
+         * The segments for ellipse mask.
+         *
+         * TODO: remove segments, not supported by graphics
+         * @zh
+         * 椭圆遮罩的曲线细分数。
+         */
+        get segments(): number;
+        set segments(value: number);
+        /**
+         * @en
+         * The mask image.
+         *
+         * @zh
+         * 遮罩所需要的贴图。
+         * @deprecated since v3.6.1
+         */
+        get spriteFrame(): SpriteFrame | null;
+        set spriteFrame(value: SpriteFrame | null);
+        /**
+         * @en
+         * The alpha threshold.(Not supported Canvas Mode) <br/>
+         * The content is drawn only where the stencil have pixel with alpha greater than the alphaThreshold. <br/>
+         * Should be a float between 0 and 1. <br/>
+         * This default to 0.1.
+         * When it's set to 1, the stencil will discard all pixels, nothing will be shown.
+         * @zh
+         * Alpha 阈值(不支持 Canvas 模式)<br/>
+         * 只有当模板的像素的 alpha 大于等于 alphaThreshold 时,才会绘制内容。<br/>
+         * 该数值 0 ~ 1 之间的浮点数,默认值为 0.1
+         * 当被设置为 1 时,会丢弃所有蒙版像素,所以不会显示任何内容
+         */
+        get alphaThreshold(): number;
+        set alphaThreshold(value: number);
+        /**
+         * @en Rendering component for providing stencil buffer information.
+         * @zh 用于提供 stencil buffer 信息的渲染组件。
+         */
+        get subComp(): Sprite | GraphicsComponent | null;
+        protected _type: MaskType;
+        protected _inverted: boolean;
+        protected _segments: number;
+        protected _alphaThreshold: number;
+        protected _sprite: Sprite | null;
+        protected _graphics: GraphicsComponent | null;
+        protected _stencilStage: __private._cocos_2d_renderer_stencil_manager__Stage;
+        onLoad(): void;
+        onEnable(): void;
+        onRestore(): void;
+        onDisable(): void;
+        onDestroy(): void;
+        /**
+         * @en Hit test with point in World Space.
+         * @zh 世界空间中的点击测试。
+         * @param worldPt @en point in World Space. @zh 世界空间中的点击点。
+         */
+        isHit(worldPt: math.Vec2): boolean;
+        protected _nodeStateChange(type: TransformBit): void;
+        protected _createSprite(): void;
+        protected _createGraphics(): void;
+        protected _updateGraphics(): void;
+        protected _enableRender(): void;
+        protected _disableRender(): void;
+        protected _removeMaskNode(): void;
+        /**
+         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
+         * you can directly manipulate the rendering components under the same node to complete the operation
+         */
+        get customMaterial(): Material | null;
+        set customMaterial(val: Material | null);
+        /**
+         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
+         * you can directly manipulate the rendering components under the same node to complete the operation
+         */
+        get color(): math.Color | null;
+        set color(value: math.Color | null);
+        /**
+         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
+         * you can directly manipulate the rendering components under the same node to complete the operation
+         */
+        markForUpdateRenderData(enable?: boolean): void;
+        /**
+         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
+         * you can directly manipulate the rendering components under the same node to complete the operation
+         */
+        requestRenderData(any: any): void;
+        /**
+         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
+         * you can directly manipulate the rendering components under the same node to complete the operation
+         */
+        destroyRenderData(): void;
+        /**
+         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
+         * you can directly manipulate the rendering components under the same node to complete the operation
+         */
+        updateRenderer(): void;
+        /**
+         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
+         * you can directly manipulate the rendering components under the same node to complete the operation
+         */
+        fillBuffers(render: any): void;
+        /**
+         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
+         * you can directly manipulate the rendering components under the same node to complete the operation
+         */
+        postUpdateAssembler(render: any): void;
+        /**
+         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
+         * you can directly manipulate the rendering components under the same node to complete the operation
+         */
+        setNodeDirty(): void;
+        /**
+         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
+         * you can directly manipulate the rendering components under the same node to complete the operation
+         */
+        setTextureDirty(): void;
+        /**
+         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
+         * you can directly manipulate the rendering components under the same node to complete the operation
+         */
+        get sharedMaterial(): Material | null;
+        /**
+         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
+         * you can directly manipulate the rendering components under the same node to complete the operation
+         */
+        get sharedMaterials(): (Material | null)[] | null;
+        set sharedMaterials(val: (Material | null)[] | null);
+        /**
+         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
+         * you can directly manipulate the rendering components under the same node to complete the operation
+         */
+        get material(): any;
+        set material(val: any);
+        /**
+         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
+         * you can directly manipulate the rendering components under the same node to complete the operation
+         */
+        get materials(): (any)[];
+        set materials(val: (any)[]);
+        /**
+         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
+         * you can directly manipulate the rendering components under the same node to complete the operation
+         */
+        getMaterial(idx: number): any;
+        /**
+         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
+         * you can directly manipulate the rendering components under the same node to complete the operation
+         */
+        setMaterial(material: Material | renderer.MaterialInstance | null, index: number): void;
+        /**
+         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
+         * you can directly manipulate the rendering components under the same node to complete the operation
+         */
+        getMaterialInstance(idx: number): any;
+        /**
+         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
+         * you can directly manipulate the rendering components under the same node to complete the operation
+         */
+        setMaterialInstance(matInst: Material | renderer.MaterialInstance | null, index: number): void;
+        /**
+         * @deprecated Since v3.6, Because mask changes the inheritance relationship,
+         * you can directly manipulate the rendering components under the same node to complete the operation
+         */
+        getRenderMaterial(index: number): any;
+    }
+    /**
+     * @en
+     * The RichText Component.
+     *
+     * @zh
+     * 富文本组件。
+     */
+    export class RichTextComponent extends Component {
+        /**
+         * @en
+         * Content string of RichText.
+         *
+         * @zh
+         * 富文本显示的文本内容。
+         */
+        get string(): string;
+        set string(value: string);
+        /**
+         * @en
+         * Horizontal Alignment of each line in RichText.
+         *
+         * @zh
+         * 文本内容的水平对齐方式。
+         */
+        get horizontalAlign(): HorizontalTextAlignment;
+        set horizontalAlign(value: HorizontalTextAlignment);
+        /**
+         * @en
+         * Vertical Alignment of each line in RichText.
+         *
+         * @zh
+         * 文本内容的竖直对齐方式。
+         */
+        get verticalAlign(): VerticalTextAlignment;
+        set verticalAlign(value: VerticalTextAlignment);
+        /**
+         * @en
+         * Font size of RichText.
+         *
+         * @zh
+         * 富文本字体大小。
+         */
+        get fontSize(): number;
+        set fontSize(value: number);
+        /**
+         * @en
+         * Font color of RichText. Works when the text content does not have a color parameter set. Transparency cascade is not supported.
+         *
+         * @zh
+         * 富文本默认文字颜色。在文本内容没有设置颜色参数时生效。暂不支持颜色级联。
+         */
+        get fontColor(): math.Color;
+        set fontColor(value: math.Color);
+        /**
+         * @en
+         * Custom System font of RichText.
+         *
+         * @zh
+         * 富文本定制系统字体。
+         */
+        get fontFamily(): string;
+        set fontFamily(value: string);
+        /**
+         * @en
+         * Custom System font of RichText.
+         *
+         * @zh
+         * 富文本定制字体。
+         */
+        get font(): TTFFont | null;
+        set font(value: TTFFont | null);
+        /**
+         * @en
+         * Whether to use system font name or not.
+         *
+         * @zh
+         * 是否使用系统字体。
+         */
+        get useSystemFont(): boolean;
+        set useSystemFont(value: boolean);
+        /**
+         * @en
+         * The cache mode of label. This mode only supports system fonts.
+         *
+         * @zh
+         * 文本缓存模式, 该模式只支持系统字体。
+         */
+        get cacheMode(): CacheMode;
+        set cacheMode(value: CacheMode);
+        /**
+         * @en
+         * The maximize width of the RichText.
+         *
+         * @zh
+         * 富文本的最大宽度。
+         */
+        get maxWidth(): number;
+        set maxWidth(value: number);
+        /**
+         * @en
+         * Line Height of RichText.
+         *
+         * @zh
+         * 富文本行高。
+         */
+        get lineHeight(): number;
+        set lineHeight(value: number);
+        /**
+         * @en
+         * The image atlas for the img tag. For each src value in the img tag, there should be a valid spriteFrame in the image atlas.
+         *
+         * @zh
+         * 对于 img 标签里面的 src 属性名称,都需要在 imageAtlas 里面找到一个有效的 spriteFrame,否则 img tag 会判定为无效。
+         */
+        get imageAtlas(): SpriteAtlas | null;
+        set imageAtlas(value: SpriteAtlas | null);
+        /**
+         * @en
+         * Once checked, the RichText will block all input events (mouse and touch) within
+         * the bounding box of the node, preventing the input from penetrating into the underlying node.
+         *
+         * @zh
+         * 选中此选项后,RichText 将阻止节点边界框中的所有输入事件(鼠标和触摸),从而防止输入事件穿透到底层节点。
+         */
+        get handleTouchEvent(): boolean;
+        set handleTouchEvent(value: boolean);
+        /**
+         * @en Enum for horizontal text alignment.
+         *
+         * @zh 文本横向对齐类型。
+         */
+        static HorizontalAlign: typeof HorizontalTextAlignment;
+        /**
+         * @en Enum for vertical text alignment.
+         *
+         * @zh 文本垂直对齐类型。
+         */
+        static VerticalAlign: typeof VerticalTextAlignment;
+        protected _lineHeight: number;
+        protected _string: string;
+        protected _horizontalAlign: HorizontalTextAlignment;
+        protected _verticalAlign: VerticalTextAlignment;
+        protected _fontSize: number;
+        protected _fontColor: math.Color;
+        protected _maxWidth: number;
+        protected _fontFamily: string;
+        protected _font: TTFFont | null;
+        protected _isSystemFontUsed: boolean;
+        protected _userDefinedFont: TTFFont | null;
+        protected _cacheMode: CacheMode;
+        protected _imageAtlas: SpriteAtlas | null;
+        protected _handleTouchEvent: boolean;
+        protected _textArray: IHtmlTextParserResultObj[];
+        protected _segments: __private._cocos_2d_components_rich_text__ISegment[];
+        protected _labelSegmentsCache: __private._cocos_2d_components_rich_text__ISegment[];
+        protected _linesWidth: number[];
+        protected _lineCount: number;
+        protected _labelWidth: number;
+        protected _labelHeight: number;
+        protected _layoutDirty: boolean;
+        protected _lineOffsetX: number;
+        protected _updateRichTextStatus: () => void;
+        protected _labelChildrenNum: number;
+        constructor();
+        onLoad(): void;
+        onEnable(): void;
+        onDisable(): void;
+        onRestore(): void;
+        onDestroy(): void;
+        protected _addEventListeners(): void;
+        protected _removeEventListeners(): void;
+        protected _updateLabelSegmentTextAttributes(): void;
+        protected _createFontLabel(str: string): __private._cocos_2d_components_rich_text__ISegment;
+        protected _createImage(spriteFrame: SpriteFrame): __private._cocos_2d_components_rich_text__ISegment;
+        protected _onTTFLoaded(): void;
+        protected _measureText(styleIndex: number, string?: string): number | ((s: string) => number);
+        protected _onTouchEnded(event: EventTouch): void;
+        protected _containsTouchLocation(label: __private._cocos_2d_components_rich_text__ISegment, point: math.Vec2): boolean;
+        protected _resetState(): void;
+        protected _activateChildren(active: any): void;
+        protected _addLabelSegment(stringToken: string, styleIndex: number): __private._cocos_2d_components_rich_text__ISegment;
+        protected _updateRichTextWithMaxWidth(labelString: string, labelWidth: number, styleIndex: number): void;
+        protected _isLastComponentCR(stringToken: any): boolean;
+        protected _updateLineInfo(): void;
+        protected _needsUpdateTextLayout(newTextArray: IHtmlTextParserResultObj[]): boolean;
+        protected _addRichTextImageElement(richTextElement: IHtmlTextParserResultObj): void;
+        protected _updateTextDefaultColor(): void;
+        protected _updateRichText(): void;
+        protected _getFirstWordLen(text: string, startIndex: number, textLen: number): number;
+        protected _updateRichTextPosition(): void;
+        protected _convertLiteralColorValue(color: string): math.Color;
+        protected _applyTextAttribute(labelSeg: __private._cocos_2d_components_rich_text__ISegment): void;
+        protected _applyLayer(): void;
+        protected _resetLabelState(label: Label): void;
+    }
+    /**
+     * @en
+     * Graphics component.
+     *
+     * @zh
+     * 自定义图形类。
+     */
+    export class GraphicsComponent extends UIRenderer {
+        /**
+         * @en
+         * Current line width.
+         *
+         * @zh
+         * 当前线条宽度。
+         */
+        get lineWidth(): number;
+        set lineWidth(value: number);
+        /**
+         * @en
+         * Determines how two connecting segments (of lines, arcs or curves) with non-zero lengths in a shape are joined together.
+         *
+         * @zh
+         * 用来设置2个长度不为0的相连部分(线段,圆弧,曲线)如何连接在一起的属性。
+         */
+        get lineJoin(): __private._cocos_2d_assembler_graphics_types__LineJoin;
+        set lineJoin(value: __private._cocos_2d_assembler_graphics_types__LineJoin);
+        /**
+         * @en
+         * Determines how the end points of every line are drawn.
+         *
+         * @zh
+         * 指定如何绘制每一条线段末端。
+         */
+        get lineCap(): __private._cocos_2d_assembler_graphics_types__LineCap;
+        set lineCap(value: __private._cocos_2d_assembler_graphics_types__LineCap);
+        /**
+         * @en
+         * Brush stroke color.
+         *
+         * @zh
+         * 笔触的颜色。
+         */
+        get strokeColor(): Readonly<math.Color>;
+        set strokeColor(value: Readonly<math.Color>);
+        /**
+         * @en
+         * Fill paint color.
+         *
+         * @zh
+         * 填充绘画的颜色。
+         */
+        get fillColor(): Readonly<math.Color>;
+        set fillColor(value: Readonly<math.Color>);
+        /**
+         * @en
+         * Set the miter limit ratio.
+         *
+         * @zh
+         * 设置斜接面限制比例。
+         */
+        get miterLimit(): number;
+        set miterLimit(value: number);
+        get color(): math.Color;
+        set color(value: math.Color);
+        static LineJoin: typeof __private._cocos_2d_assembler_graphics_types__LineJoin;
+        static LineCap: typeof __private._cocos_2d_assembler_graphics_types__LineCap;
+        impl: __private._cocos_2d_assembler_graphics_webgl_impl__Impl | null;
+        /**
+         * @deprecated since v3.6.0, this is an engine private interface that will be removed in the future.
+         */
+        model: renderer.scene.Model | null;
+        protected _lineWidth: number;
+        protected _strokeColor: math.Color;
+        protected _lineJoin: __private._cocos_2d_assembler_graphics_types__LineJoin;
+        protected _lineCap: __private._cocos_2d_assembler_graphics_types__LineCap;
+        protected _fillColor: math.Color;
+        protected _miterLimit: number;
+        protected _isDrawing: boolean;
+        protected _isNeedUploadData: boolean;
+        protected _graphicsNativeProxy: __private._cocos_2d_renderer_native_2d__NativeUIModelProxy;
+        /**
+         * @deprecated since v3.7.0, this is an engine private interface that will be removed in the future.
+         */
+        get graphicsNativeProxy(): __private._cocos_2d_renderer_native_2d__NativeUIModelProxy;
+        constructor();
+        onRestore(): void;
+        onLoad(): void;
+        onEnable(): void;
+        onDestroy(): void;
+        /**
+         * @en
+         * Move path start point to (x,y).
+         *
+         * @zh
+         * 移动路径起点到坐标(x, y)。
+         *
+         * @param x @en The x-axis coordinate of the target position.
+         *          @zh 目标位置的 X 轴坐标。
+         * @param y @en The y-axis coordinate of the target position.
+         *          @zh 目标位置的 y 轴坐标。
+         */
+        moveTo(x: number, y: number): void;
+        /**
+         * @en
+         * Adds a straight line to the path.
+         *
+         * @zh
+         * 绘制直线路径。
+         *
+         * @param x @en The x-axis coordinate of the target position.
+         *          @zh 目标位置的 x 轴坐标。
+         * @param y @en The x-axis coordinate of the target position.
+         *          @zh 目标位置的 y 轴坐标。
+         */
+        lineTo(x: number, y: number): void;
+        /**
+         * @en
+         * Adds a cubic Bézier curve to the path.
+         *
+         * @zh
+         * 绘制三次贝赛尔曲线路径。
+         *
+         * @param c1x @en The x-axis coordinate of the first control point.
+         *            @zh 第一个控制点的 x 轴坐标。
+         * @param c1y @en The y-axis coordinate of the first control point.
+         *            @zh 第一个控制点的 y 轴坐标。
+         * @param c2x @en The x-axis coordinate of the second control point.
+         *            @zh 第二个控制点的 x 轴坐标。
+         * @param c2y @en The y-axis coordinate of the second control point.
+         *            @zh 第二个控制点的 y 轴坐标。
+         * @param x @en The x-axis coordinate of the last control point.
+         *          @zh 最后一个控制点的 x 轴坐标。
+         * @param y @en The y-axis coordinate of the last control point.
+         *          @zh 最后一个控制点的 y 轴坐标。
+         */
+        bezierCurveTo(c1x: number, c1y: number, c2x: number, c2y: number, x: number, y: number): void;
+        /**
+         * @en
+         * Adds a quadratic Bézier curve to the path.
+         *
+         * @zh
+         * 绘制二次贝赛尔曲线路径。
+         *
+         * @param cx @en The x-axis coordinate of the starting control point.
+         *           @zh 起始控制点的 x 轴坐标。
+         * @param cy @en The y-axis coordinate of the starting control point.
+         *           @zh 起始控制点的 y 轴坐标。
+         * @param x @en The x-axis coordinates of the endpoint control point.
+         *          @zh 终点控制点的 x 轴坐标。
+         * @param y @en The y-axis coordinates of the endpoint control point.
+         *          @zh 终点控制点的 x 轴坐标。
+         */
+        quadraticCurveTo(cx: number, cy: number, x: number, y: number): void;
+        /**
+         * @en
+         * Adds an arc to the path which is centered at (cx, cy) position with radius r starting at startAngle
+         * and ending at endAngle going in the given direction by counterclockwise (defaulting to false).
+         *
+         * @zh
+         * 绘制圆弧路径。圆弧路径的圆心在 (cx, cy) 位置,半径为 r ,根据 counterclockwise (默认为false)指定的方向从 startAngle 开始绘制,到 endAngle 结束。
+         *
+         * @param cx @en The coordinate x-axis of the central control point.
+         *           @zh 中心控制点的坐标 x 轴。
+         * @param cy @en The coordinate y-axis of the central control point.
+         *           @zh 中心控制点的坐标 y 轴。
+         * @param r @en Angle in Radian.
+         *          @zh 圆弧弧度。
+         * @param startAngle @en The starting angle in radian, measured clockwise from the positive x-axis.
+         *                   @zh 弧度起点,从正 x 轴顺时针方向测量。
+         * @param endAngle @en The ending angle in radian, measured clockwise from the positive x-axis.
+         *                 @zh 弧度终点,从正 x 轴顺时针方向测量。
+         * @param counterclockwise @en If true, draws counterclockwise between the two angles. Default is clockwise.
+         *                         @zh 如果为真,在两个角度之间逆时针绘制。默认顺时针。
+         */
+        arc(cx: number, cy: number, r: number, startAngle: number, endAngle: number, counterclockwise: boolean): void;
+        /**
+         * @en
+         * Adds an ellipse to the path.
+         *
+         * @zh
+         * 绘制椭圆路径。
+         *
+         * @param cx @en The x-axis coordinates of the center point.
+         *           @zh 中心点的 x 轴坐标。
+         * @param cy @en The y-axis coordinates of the center point.
+         *           @zh 中心点的 y 轴坐标。
+         * @param rx @en The radius of the x-axis of the ellipse.
+         *           @zh 椭圆 x 轴半径。
+         * @param ry @en The radius of the y-axis of the ellipse.
+         *           @zh 椭圆 y 轴半径。
+         */
+        ellipse(cx: number, cy: number, rx: number, ry: number): void;
+        /**
+         * @en
+         * Adds a circle to the path.
+         *
+         * @zh
+         * 绘制圆形路径。
+         *
+         * @param cx @en The x-axis coordinates of the center point.
+         *           @zh 中心点的 x 轴坐标。
+         * @param cy @en The y-axis coordinates of the center point.
+         *           @zh 中心点的 y 轴坐标。
+         * @param r @en Radius.
+         *          @zh 圆半径。
+         */
+        circle(cx: number, cy: number, r: number): void;
+        /**
+         * @en
+         * Adds a rectangle to the path.
+         *
+         * @zh
+         * 绘制矩形路径。
+         *
+         * @param x @en The x-axis coordinate of the top left point of the rectangle.
+         *          @zh 矩形起始 x 轴坐标。
+         * @param y @en The y-axis coordinate of the top left point of the rectangle.
+         *          @zh 矩形起始 y 轴坐标。
+         * @param w @en The width of the rectangle.
+         *          @zh 矩形宽度。
+         * @param h @en The height of the rectangle.
+         *          @zh 矩形高度。
+         */
+        rect(x: number, y: number, w: number, h: number): void;
+        /**
+         * @en
+         * Adds a round corner rectangle to the path.
+         *
+         * @zh
+         * 绘制圆角矩形路径。
+         *
+         * @param x @en The x-axis coordinate of the top left point of the rectangle.
+         *          @zh 矩形起始 x 轴坐标。
+         * @param y @en The y-axis coordinate of the top left point of the rectangle.
+         *          @zh 矩形起始 y 轴坐标。
+         * @param w @en The width of the rectangle.
+         *          @zh 矩形宽度。
+         * @param h @en The height of the rectangle.
+         *          @zh 矩形高度。
+         * @param r @en Radius of rectangular rounded corners.
+         *          @zh 矩形圆角半径。
+         */
+        roundRect(x: number, y: number, w: number, h: number, r: number): void;
+        /**
+         * @en
+         * Draws a filled rectangle.
+         *
+         * @zh
+         * 绘制填充矩形。
+         *
+         * @param x @en The x-axis coordinate of the top left point of the rectangle.
+         *          @zh 矩形起始 x 轴坐标。
+         * @param y @en The y-axis coordinate of the top left point of the rectangle.
+         *          @zh 矩形起始 y 轴坐标。
+         * @param w @en The width of the rectangle.
+         *          @zh 矩形宽度。
+         * @param h @en The height of the rectangle.
+         *          @zh 矩形高度。
+         */
+        fillRect(x: number, y: number, w: number, h: number): void;
+        /**
+         * @en
+         * Erasing any previously drawn content.
+         *
+         * @zh
+         * 擦除之前绘制的所有内容的方法。
+         */
+        clear(): void;
+        /**
+         * @en
+         * Causes the point of the pen to move back to the start of the current path.
+         * It tries to add a straight line from the current point to the start.
+         *
+         * @zh
+         * 将笔点返回到当前路径起始点的。它尝试从当前点到起始点绘制一条直线。
+         */
+        close(): void;
+        /**
+         * @en
+         * Strokes the current or given path with the current stroke style.
+         *
+         * @zh
+         * 根据当前的画线样式,绘制当前或已经存在的路径。
+         */
+        stroke(): void;
+        /**
+         * @en
+         * Fills the current or given path with the current fill style.
+         *
+         * @zh
+         * 根据当前的画线样式,填充当前或已经存在的路径。
+         */
+        fill(): void;
+        /**
+         * @deprecated since v3.7.0, this is an engine private interface that will be removed in the future.
+         */
+        activeSubModel(idx: number): void;
+        protected _uploadData(): void;
+        protected _render(render: __private._cocos_2d_renderer_i_batcher__IBatcher): void;
+        protected _flushAssembler(): void;
+        protected _canRender(): boolean;
+        /**
+         * @deprecated since v3.7.0, this is an engine private interface that will be removed in the future.
+         */
+        updateRenderer(): void;
+        protected createRenderEntity(): __private._cocos_2d_renderer_render_entity__RenderEntity;
+    }
+    /**
      * @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
      */
     export interface IRenderData {
         x: number;
@@ -5718,8 +5661,117 @@
          */
         BLEND_PROBES_AND_SKYBOX = 4
     }
     /**
+     * @en `AffineTransform` class represent an affine transform matrix. It's composed basically by translation, rotation, scale transformations.
+     * @zh 二维仿射变换矩阵,描述了平移、旋转和缩放。
+     */
+    export class AffineTransform {
+        /**
+         * @en Create an identity transformation matrix.
+         * @zh 创建单位二维仿射变换矩阵,它不进行任何变换。
+         */
+        static identity(): AffineTransform;
+        /**
+         * @en Clone an `AffineTransform` object from the specified transform.
+         * @zh 克隆指定的二维仿射变换矩阵。
+         * @param affineTransform Specified `AffineTransform` objects
+         */
+        static clone(affineTransform: AffineTransform): AffineTransform;
+        /**
+         * @en Concatenate a transform matrix to another. The results are reflected in the out `AffineTransform`.
+         * First apply t1, then t2: out * v = t2 * (t1 * v).
+         * @zh 将两个矩阵相乘的结果赋值给输出矩阵,先应用t1再应用t2: out * v = t2 * (t1 * v)。
+         * @param out Out object to store the concat result
+         * @param t1 The first transform object.
+         * @param t2 The transform object to concatenate.
+         */
+        static concat(out: AffineTransform, t1: AffineTransform, t2: AffineTransform): void;
+        /**
+         * @en Get the invert transform of an `AffineTransform` object.
+         * @zh 将矩阵求逆的结果赋值给输出矩阵。
+         * @param out Out object to store the invert result
+         * @param t the input `AffineTransform` object
+         */
+        static invert(out: AffineTransform, t: AffineTransform): void;
+        /**
+         * @en Get an `AffineTransform` object from a given matrix 4x4.
+         * @zh 将四维矩阵转换为二维仿射变换矩阵并赋值给输出矩阵。
+         * @param out The output matrix to store the result
+         * @param mat transform matrix.
+         */
+        static fromMat4(out: AffineTransform, mat: math.Mat4): void;
+        /**
+         * @en Apply the `AffineTransform` on a 2D vector.
+         * @zh 应用二维仿射变换矩阵到二维向量上,并将结果赋值给输出向量。
+         * @param out The output vector to store the result
+         * @param point Vector to apply transform.
+         * @param t transform matrix.
+         */
+        static transformVec2(out: math.Vec2, point: math.Vec2, t: AffineTransform): void;
+        /**
+         * @en Apply the `AffineTransform` on a 2D vector.
+         * @zh 应用二维仿射变换矩阵到二维向量上,并将结果赋值给输出向量。
+         * @param out The output vector to store the result
+         * @param x x to apply transform.
+         * @param y y to apply transform.
+         * @param t transform matrix.
+         */
+        static transformVec2(out: math.Vec2, x: number, y: number, t: AffineTransform): void;
+        /**
+         * @en Apply the `AffineTransform` on a size.
+         * @zh 应用二维仿射变换矩阵到二维尺寸上,并将结果赋值给输出尺寸。
+         * @param out The output size to store the result
+         * @param size The size to apply transform.
+         * @param t transform matrix.
+         */
+        static transformSize(out: math.Size, size: math.Size, t: AffineTransform): void;
+        /**
+         * @en Apply the `AffineTransform` on a rect.
+         * @zh 应用二维仿射变换矩阵到矩形上,并将结果赋值给输出矩形。
+         * @param out The output rect object to store the result
+         * @param rect The rect object to apply transform.
+         * @param t transform matrix.
+         */
+        static transformRect(out: math.Rect, rect: math.Rect, t: AffineTransform): void;
+        /**
+         * @en Apply the `AffineTransform` on a rect, and turns to an Oriented Bounding Box.
+         * This function does not allocate any memory, you should create the output vectors by yourself and manage their memory.
+         * @zh 应用二维仿射变换矩阵到矩形上, 并转换为有向包围盒。
+         * 这个函数不创建任何内存,你需要先创建包围盒的四个 Vector 对象用来存储结果,并作为前四个参数传入函数。
+         * @param out_bl Output vector for storing the bottom left corner coordinates of the Obb object
+         * @param out_tl Output vector for storing the top left corner coordinates of the Obb object
+         * @param out_tr Output vector for storing the top right corner coordinates of the Obb object
+         * @param out_br Output vector for storing the bottom right corner coordinates of the Obb object
+         * @param rect The rect object to apply transform.
+         * @param anAffineTransform transform matrix.
+         */
+        static transformObb(out_bl: math.Vec2, out_tl: math.Vec2, out_tr: math.Vec2, out_br: math.Vec2, rect: math.Rect, anAffineTransform: AffineTransform, flipY?: boolean): void;
+        /**
+         * matrix layout
+         * |a  c  tx|
+         * |b  d  ty|
+         * |0  0  1 |
+         */
+        a: number;
+        b: number;
+        c: number;
+        d: number;
+        tx: number;
+        ty: number;
+        /**
+         * @en constructor an `AffineTransform` object.
+         * @zh 构造二维放射变换矩阵。
+         * @param a a
+         * @param b b
+         * @param c c
+         * @param d d
+         * @param tx tx
+         * @param ty ty
+         */
+        constructor(a?: number, b?: number, c?: number, d?: number, tx?: number, ty?: number);
+    }
+    /**
      * @zh 动画剪辑表示一段使用动画编辑器编辑的关键帧动画或是外部美术工具生产的骨骼动画。
      * 它的数据主要被分为几层:轨道、关键帧和曲线。
      * @en The animation clip represents a sequence of key frame animation created with the animation editor or skeletal animation other DCC tools.
      * The data is divided in different levels: tracks, key frames, curves.
@@ -16755,117 +16807,8 @@
         }
         export function mat4(other: Mat4): Mat4;
         export function mat4(m00?: number, m01?: number, m02?: number, m03?: number, m10?: number, m11?: number, m12?: number, m13?: number, m20?: number, m21?: number, m22?: number, m23?: number, m30?: number, m31?: number, m32?: number, m33?: number): Mat4;
         /**
-         * @en `AffineTransform` class represent an affine transform matrix. It's composed basically by translation, rotation, scale transformations.
-         * @zh 二维仿射变换矩阵,描述了平移、旋转和缩放。
-         */
-        export class AffineTransform {
-            /**
-             * @en Create an identity transformation matrix.
-             * @zh 创建单位二维仿射变换矩阵,它不进行任何变换。
-             */
-            static identity(): AffineTransform;
-            /**
-             * @en Clone an `AffineTransform` object from the specified transform.
-             * @zh 克隆指定的二维仿射变换矩阵。
-             * @param affineTransform Specified `AffineTransform` objects
-             */
-            static clone(affineTransform: AffineTransform): AffineTransform;
-            /**
-             * @en Concatenate a transform matrix to another. The results are reflected in the out `AffineTransform`.
-             * First apply t1, then t2: out * v = t2 * (t1 * v).
-             * @zh 将两个矩阵相乘的结果赋值给输出矩阵,先应用t1再应用t2: out * v = t2 * (t1 * v)。
-             * @param out Out object to store the concat result
-             * @param t1 The first transform object.
-             * @param t2 The transform object to concat...*[Comment body truncated]*

@dumganhar
Copy link
Contributor Author

@cocos-robot run test cases

1 similar comment
@dumganhar
Copy link
Contributor Author

@cocos-robot run test cases

@dumganhar dumganhar marked this pull request as draft February 7, 2025 02:44
@dumganhar
Copy link
Contributor Author

@cocos-robot run test cases

1 similar comment
@dumganhar
Copy link
Contributor Author

@cocos-robot run test cases

this._world.SetDebugDraw(debugDraw);
} catch (e: any) {
errorID(4501, e.message as string);
node.destroy();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is better to set node to null too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

this._b2DebugDrawer = debugDraw;
this._world.SetDebugDraw(debugDraw as B2.Draw);
} catch (e: any) {
errorID(4501, e.message as string);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should destroy node here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.
Code updated.

@dumganhar dumganhar marked this pull request as ready for review February 8, 2025 06:25
@cocos cocos deleted a comment from github-actions bot Feb 8, 2025
@cocos cocos deleted a comment from github-actions bot Feb 8, 2025
@dumganhar
Copy link
Contributor Author

@cocos-robot run test cases

@cocos cocos deleted a comment from github-actions bot Feb 8, 2025
@cocos cocos deleted a comment from github-actions bot Feb 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants