import React from 'react';
import {RichText} from "../../sourceCode/canvas/RichText";
import {createStage,isExistStage} from "../../common/createStage";
import { useEffect } from 'react';
interface TestProps {
    /** 要展示的文本内容 */
    textArr:Array<any>;
    /** 文本中心点的x坐标 */
    x:number;
    /** 文本中心点的y坐标 */
    y:number;
  }
export const RichTextCom = (args:TestProps)=>{
    createStage();
    isExistStage(()=>{
        window.stage.removeAllChildren();
        const richText = new RichText();
          //@ts-ignore
        richText.position.set(args.x,args.y)
        richText.text = args.textArr;
        window.stage.addChild(richText);
    })
    return (
      <div></div>
    )
}