Klasse UIPainter2D

java.lang.Object
net.risingworld.api.ui.UIElement
net.risingworld.api.ui.UIPainter2D
Alle implementierten Schnittstellen:
Serializable

public class UIPainter2D extends UIElement
A simplified version of the UIMesh element. It enables you to create custom shapes and elements, but instead of providing individual vertices, this class uses a Vector API to creates lines and shapes more easily.

Please note that most style properties have no impact on the element!

Another note: Unity internally has a hard-coded mesh vertex limit of 65535 for UI elements. If the amount of vertices exceed this value, the UI element can no longer be rendered. Unfortunately there is no workaround available yet, so if your painter element becomes too complex, it could be necessary to split it into multiple instances.
Siehe auch:
  • Konstruktordetails

    • UIPainter2D

      public UIPainter2D()
  • Methodendetails

    • arc

      public void arc(Vector2f center, float radius, int startAngle, int endAngle, UIPainter2D.ArcDirection direction)
    • arcTo

      public void arcTo(Vector2f p1, Vector2f p2, float radius)
    • bezierCurveTo

      public void bezierCurveTo(Vector2f p1, Vector2f p2, Vector2f p3)
    • beginPath

      public void beginPath()
    • closePath

      public void closePath()
    • fill

      public void fill(UIPainter2D.FillRule fillRule)
    • lineTo

      public void lineTo(Vector2f pos)
    • moveTo

      public void moveTo(Vector2f pos)
    • quadraticCurveTo

      public void quadraticCurveTo(Vector2f p1, Vector2f p2)
    • stroke

      public void stroke()
    • setFillColor

      public void setFillColor(float r, float g, float b, float a)
    • setLineCap

      public void setLineCap(UIPainter2D.LineCap lineCap)
    • setLineJoin

      public void setLineJoin(UIPainter2D.LineJoin lineJoin)
    • setLineWith

      public void setLineWith(float lineWidth)
    • setMiterLimit

      public void setMiterLimit(float miterLimit)
    • setStrokeColor

      public void setStrokeColor(float r, float g, float b, float a)
    • clear

      public void clear()
    • update

      public void update()