接口 Painter

所有已知实现类:
NativePainter, TransformPainter

public interface Painter
Draw-list target. Host renderers may implement this interface instead of the bundled JNI backend.
  • 方法概要

    修饰符和类型
    方法
    说明
    void
    Freeze the already drawn UI into a new backdrop for overlays.
    void
     
    void
    colorPlane(float x, float y, float w, float h, float hue)
     
    default void
    colorPlaneAlpha(float x, float y, float w, float h, float hue, float alpha)
     
    default void
    Called by Ui.render before any widget drawing; custom backends may override.
    default void
    Scoped profile for the current widget.
    void
    fill(float x, float y, float w, float h, float radius, int color)
     
    void
    glass(float x, float y, float w, float h, float radius, Theme t, float blur)
     
    void
    line(float x, float y, float x2, float y2, float thickness, int color)
     
    default void
    Pop only the last shaped content clip; does not change the rectangular scissor.
    default void
    pushShapeClip(Rect bounds, float radius, CornerRadii profile)
    Push an intersecting rounded content clip.
    void
    ring(float x, float y, float size, float thickness, float progress, float start, int color)
     
    void
    stroke(float x, float y, float w, float h, float radius, float thickness, int color)
     
    void
    text(String text, float x, float y, float size, int color)
     
    default void
    textScaled(String text, float x, float y, float size, int color, float scale)
    Affine text scaling without regenerating rasterized glyphs on every animated frame.
    default void
    textWeight(String text, float x, float y, float size, int color, int weight)
     
    default void
    textWeightScaled(String text, float x, float y, float size, int color, int weight, float scale)
     
    float
    textWidth(String text, float size)
     
    default float
    textWidth(String text, float size, int weight)
     
  • 方法详细资料

    • configure

      default void configure(Theme theme)
      Called by Ui.render before any widget drawing; custom backends may override.
    • corners

      default void corners(CornerRadii profile)
      Scoped profile for the current widget. Null restores its normal radius argument.
    • clip

      void clip(Rect r)
    • pushShapeClip

      default void pushShapeClip(Rect bounds, float radius, CornerRadii profile)
      Push an intersecting rounded content clip. Coordinates are logical/absolute. A null profile follows the active theme, with the supplied radius. Max native depth: 32. Custom painters that do not override these methods retain the existing rectangular clips.
    • popShapeClip

      default void popShapeClip()
      Pop only the last shaped content clip; does not change the rectangular scissor.
    • glass

      void glass(float x, float y, float w, float h, float radius, Theme t, float blur)
    • fill

      void fill(float x, float y, float w, float h, float radius, int color)
    • stroke

      void stroke(float x, float y, float w, float h, float radius, float thickness, int color)
    • line

      void line(float x, float y, float x2, float y2, float thickness, int color)
    • ring

      void ring(float x, float y, float size, float thickness, float progress, float start, int color)
    • colorPlane

      void colorPlane(float x, float y, float w, float h, float hue)
    • colorPlaneAlpha

      default void colorPlaneAlpha(float x, float y, float w, float h, float hue, float alpha)
    • text

      void text(String text, float x, float y, float size, int color)
    • textWidth

      float textWidth(String text, float size)
    • textScaled

      default void textScaled(String text, float x, float y, float size, int color, float scale)
      Affine text scaling without regenerating rasterized glyphs on every animated frame.
    • textWeight

      default void textWeight(String text, float x, float y, float size, int color, int weight)
    • textWeightScaled

      default void textWeightScaled(String text, float x, float y, float size, int color, int weight, float scale)
    • textWidth

      default float textWidth(String text, float size, int weight)
    • backdrop

      void backdrop()
      Freeze the already drawn UI into a new backdrop for overlays.