Package net.risingworld.api.ui
Class UIPainter2D
java.lang.Object
net.risingworld.api.ui.UIElement
net.risingworld.api.ui.UIPainter2D
A simplified version of the
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.
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.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumstatic enumstatic enum -
Field Summary
Fields inherited from class net.risingworld.api.ui.UIElement
hoverStyle, style -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidarc(Vector2f center, float radius, int startAngle, int endAngle, UIPainter2D.ArcDirection direction) voidvoidvoidbezierCurveTo(Vector2f p1, Vector2f p2, Vector2f p3) voidclear()voidvoidfill(UIPainter2D.FillRule fillRule) voidvoidvoidquadraticCurveTo(Vector2f p1, Vector2f p2) voidsetFillColor(float r, float g, float b, float a) voidsetLineCap(UIPainter2D.LineCap lineCap) voidsetLineJoin(UIPainter2D.LineJoin lineJoin) voidsetLineWith(float lineWidth) voidsetMiterLimit(float miterLimit) voidsetStrokeColor(float r, float g, float b, float a) voidstroke()voidupdate()Methods inherited from class net.risingworld.api.ui.UIElement
addChild, addStyleSheet, addToClassList, getChildCount, getChilds, getID, getParent, getPluginID, isClickable, onClick, removeAllChilds, removeChild, removeFromClassList, removeFromParent, removeStyleSheet, resetPivot, resetPosition, setBackgroundColor, setBackgroundColor, setBorder, setBorderColor, setBorderColor, setBorderEdgeRadius, setClickable, setOpacity, setPickable, setPivot, setPosition, setSize, setVisible, updateStyle
-
Constructor Details
-
UIPainter2D
public UIPainter2D()
-
-
Method Details
-
arc
public void arc(Vector2f center, float radius, int startAngle, int endAngle, UIPainter2D.ArcDirection direction) -
arcTo
-
bezierCurveTo
-
beginPath
public void beginPath() -
closePath
public void closePath() -
fill
-
lineTo
-
moveTo
-
quadraticCurveTo
-
stroke
public void stroke() -
setFillColor
public void setFillColor(float r, float g, float b, float a) -
setLineCap
-
setLineJoin
-
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()
-