Class SXTextTrack

    • Constructor Detail

      • SXTextTrack

        public SXTextTrack​(long track,
                           long manager,
                           com.shixing.sxedit.SXTrack.SXTrackOwnType type)
    • Method Detail

      • getContent

        public java.lang.String getContent()
        获取文字内容
        Returns:
        String
      • setContent

        public void setContent​(java.lang.String content)
        设置文字内容
        Parameters:
        content - 内容
      • getStrokeWidth

        public float getStrokeWidth()
        获取描边宽度, 单位: px
        Returns:
        float
      • setStrokeWidth

        public void setStrokeWidth​(float strokeWidth)
        设置描边宽度,默认为0
        Parameters:
        strokeWidth - 宽度
      • getFontSize

        public float getFontSize()
      • setFontSize

        public void setFontSize​(float fontSize)
        设置文字大小,单位为像素
        Parameters:
        fontSize - 文字大小
      • getTracking

        public int getTracking()
      • setTracking

        public void setTracking​(int tracking)
      • getFontFile

        public java.lang.String getFontFile()
      • setFontFile

        public void setFontFile​(java.lang.String fontFile)
        设置字体文件,默认使用初始设置的默认字体文件
        Parameters:
        fontFile - 字体文件本地路径
      • setStrokeStyle

        public void setStrokeStyle​(SXTextStrokeStyle style)
        设置描边绘制方式,默认描边画在文字之下
        Parameters:
        style - 描边方式
      • setDirection

        public void setDirection​(SXTextDirectionType direction)
        设置文字方向
        Parameters:
        direction - 横向或纵向
      • setAlignment

        public void setAlignment​(SXTextAlignmentType type)
        设置排版方式
        Parameters:
        type - 排版方式
      • setFillColor

        public void setFillColor​(float red,
                                 float green,
                                 float blue)
        设置填充颜色,默认为白色
        Parameters:
        red - 范围 [0, 1]
        green - 范围 [0, 1]
        blue - 范围 [0, 1]
      • setFillColor

        public void setFillColor​(int color)
        设置填充颜色,默认为白色
        Parameters:
        color - 填充颜色
      • setFillColor

        public void setFillColor​(java.lang.String hexColorString)
        设置填充颜色
        Parameters:
        hexColorString - , 十六进制颜色字符串, 比如 #00FF00, #00FF00FF
      • setStrokeColor

        public void setStrokeColor​(float red,
                                   float green,
                                   float blue)
        设置描边颜色, 默认为白色
        Parameters:
        red -
        green -
        blue -
      • setStrokeColor

        public void setStrokeColor​(int color)
        设置填充颜色,默认为白色
        Parameters:
        color - 填充颜色
      • setStrokeColor

        public void setStrokeColor​(java.lang.String hexColorString)
        设置描边颜色
        Parameters:
        hexColorString - , 十六进制颜色字符串, 比如 #00FF00, #00FF00FF
      • setBubble

        public boolean setBubble​(java.lang.String resourcePath)
        设置文字气泡
        Parameters:
        resourcePath - , 文字气泡本地路径
        Returns:
        boolean
      • removeBubble

        public void removeBubble()
        删除文字气泡
      • getBubbleResource

        public SXResource getBubbleResource()
        获取文字气泡素材对象
        Returns:
        SXResource
      • setTextStyle

        public boolean setTextStyle​(java.lang.String resourcePath)
        设置文字样式
        Parameters:
        resourcePath - , 文字样式本地路径
        Returns:
        boolean
      • resetTextStyle

        public void resetTextStyle()
        重置文字样式
      • getStyleResource

        public SXResource getStyleResource()
        获取文字样式素材对象
        Returns:
        SXResource
      • removeTextAnimation

        public boolean removeTextAnimation​(java.lang.String textAnimationId)
        Description copied from interface: SXTextAnimationDelegate
        删除文字动画
        Specified by:
        removeTextAnimation in interface SXTextAnimationDelegate
        Parameters:
        textAnimationId - 文字动画ID
        Returns:
        删除成功返回true,否则返回false