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
Modifier and TypeClassDescriptionstatic enum
static enum
static enum
static enum
-
Field Summary
Fields inherited from class net.risingworld.api.ui.UIElement
hoverStyle, style
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
arc
(Vector2f center, float radius, int startAngle, int endAngle, UIPainter2D.ArcDirection direction) void
void
void
bezierCurveTo
(Vector2f p1, Vector2f p2, Vector2f p3) void
clear()
void
void
fill
(UIPainter2D.FillRule fillRule) void
void
void
quadraticCurveTo
(Vector2f p1, Vector2f p2) void
setFillColor
(float r, float g, float b, float a) void
setLineCap
(UIPainter2D.LineCap lineCap) void
setLineJoin
(UIPainter2D.LineJoin lineJoin) void
setLineWith
(float lineWidth) void
setMiterLimit
(float miterLimit) void
setStrokeColor
(float r, float g, float b, float a) void
stroke()
void
update()
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()
-