RibbonLayer
World canvas layer rendering textured or solid ribbon lines, paths, and waypoint routes in world coordinates.
Overview
RibbonLayer renders continuous textured or solid ribbon lines, waypoint routes, and geometric paths within a WorldCanvas.
Key features:
- Textured or solid color ribbons with configurable world width and texture repeat distance (width, textureLength).
- Mesh caching: geometry is cached until points, camera viewport, or styling options change.
- Advanced styling via RibbonOptions: closed paths, miter limits, UV swapping/flipping, and rounded joint dots.
- Point list manipulation: path, addPoint, clear.
Drawing Textured Ribbon Path
RibbonLayer ribbon = new RibbonLayer()
.width(16.0f)
.addPoint(0, 0)
.addPoint(100, 150);
canvas.addWorldLayer(ribbon);
Related links
- WorldCanvas: Infinite 2D/3D world canvas supporting camera pan and zoom, coordinate transformations, background world layers, and pinned screen-space anchor widgets.
- WorldLayer: Functional contract for background or decorative rendering layers drawn inside WorldCanvas.
API
RibbonLayer::addPoint(float, float)
Appends a new point in world coordinates to the end of the ribbon path.
| Parameter | Type | Description |
|---|---|---|
worldX |
float |
World X coordinate. |
worldY |
float |
World Y coordinate. |
Returns RibbonLayer: This instance for chaining..
RibbonLayer::cacheHits()
Returns the count of successful mesh cache hits.
Returns long: The integer count value..
RibbonLayer::cacheRebuilds()
Returns the count of mesh cache rebuilds.
Returns long: The integer count value..
RibbonLayer::clear()
Clears all points from the ribbon path.
Returns RibbonLayer: This instance for chaining..
RibbonLayer::closed()
Returns true if the ribbon path forms a closed loop.
Returns boolean: True if active, enabled, or successful..
RibbonLayer::closed(boolean)
Configures whether the ribbon path connects its end back to its start.
| Parameter | Type | Description |
|---|---|---|
closed |
boolean |
Whether the ribbon forms a closed loop. |
Returns RibbonLayer: This instance for chaining..
RibbonLayer::flipU()
Returns true if the horizontal U texture coordinate is inverted.
Returns boolean: True if active, enabled, or successful..
RibbonLayer::flipU(boolean)
Configures horizontal inversion of the texture U coordinate.
| Parameter | Type | Description |
|---|---|---|
flipU |
boolean |
Whether to flip the horizontal U texture coordinate. |
Returns RibbonLayer: This instance for chaining..
RibbonLayer::flipV()
Returns true if the vertical V texture coordinate is inverted.
Returns boolean: True if active, enabled, or successful..
RibbonLayer::flipV(boolean)
Configures vertical inversion of the texture V coordinate.
| Parameter | Type | Description |
|---|---|---|
flipV |
boolean |
Whether to flip the vertical V texture coordinate. |
Returns RibbonLayer: This instance for chaining..
RibbonLayer::invalidateCache()
Forces invalidation of the cached mesh geometry.
RibbonLayer::jointDots()
Returns true if rounded joint filler dots are rendered at path vertices.
Returns boolean: True if active, enabled, or successful..
RibbonLayer::jointDots(boolean)
Configures rendering of rounded joint filler dots at path vertices.
| Parameter | Type | Description |
|---|---|---|
jointDots |
boolean |
Whether to render rounded joint dots at vertices. |
Returns RibbonLayer: This instance for chaining..
RibbonLayer::jointSegments()
Returns the segment count used for rounded joint circles.
Returns int: The integer count value..
RibbonLayer::jointSegments(int)
Sets the segment count used for rounded joint circles.
| Parameter | Type | Description |
|---|---|---|
jointSegments |
int |
Number of circle segments for rounded joint dots. |
Returns RibbonLayer: This instance for chaining..
RibbonLayer::miterLimit()
Returns the miter join bevel threshold.
Returns float: The floating-point coordinate or dimension value..
RibbonLayer::miterLimit(float)
Sets the miter join bevel threshold.
| Parameter | Type | Description |
|---|---|---|
miterLimit |
float |
Miter join bevel limit threshold. |
Returns RibbonLayer: This instance for chaining..
RibbonLayer::options()
Returns the active ribbon generation options.
Returns RibbonOptions: The active RibbonOptions..
RibbonLayer::options(RibbonOptions)
Sets the ribbon generation options.
| Parameter | Type | Description |
|---|---|---|
options |
RibbonOptions |
Ribbon options controlling rendering and tessellation. |
Returns RibbonLayer: This instance for chaining..
RibbonLayer::path()
Returns an unmodifiable view of all world points along the ribbon path.
Returns List: Unmodifiable list of world points..
RibbonLayer::path(List)
Replaces the entire ribbon path with the given list of world points.
| Parameter | Type | Description |
|---|---|---|
points |
List |
List of world coordinate points defining the ribbon path. |
Returns RibbonLayer: This instance for chaining..
RibbonLayer::render(WorldCanvas, DrawScope)
Renders the ribbon mesh into the canvas draw scope.
| Parameter | Type | Description |
|---|---|---|
canvas |
WorldCanvas |
WorldCanvas hosting this ribbon layer. |
draw |
DrawScope |
DrawScope for recording ribbon mesh draw commands. |
RibbonLayer::resetCacheStats()
Resets mesh caching diagnostic statistics.
RibbonLayer::swapUv()
Returns true if U and V texture axes are swapped.
Returns boolean: True if active, enabled, or successful..
RibbonLayer::swapUv(boolean)
Configures swapping of U and V texture axes.
| Parameter | Type | Description |
|---|---|---|
swapUv |
boolean |
Whether to swap U and V texture axes. |
Returns RibbonLayer: This instance for chaining..
RibbonLayer::texture()
Returns the texture handle applied to this ribbon, or null for solid color fill.
Returns TextureHandle: The texture handle..
RibbonLayer::texture(TextureHandle)
Sets the texture applied to this ribbon.
| Parameter | Type | Description |
|---|---|---|
texture |
TextureHandle |
Texture handle. |
Returns RibbonLayer: This instance for chaining..
RibbonLayer::textureLength()
Returns the world-space distance corresponding to one full texture tile repeat.
Returns float: The floating-point coordinate or dimension value..
RibbonLayer::textureLength(float)
Sets the world-space distance for one full texture tile repeat.
| Parameter | Type | Description |
|---|---|---|
textureLength |
float |
Distance in world units for one full texture tile repeat. |
Returns RibbonLayer: This instance for chaining..
RibbonLayer::tint()
Returns the mutable vertex tint color of the ribbon.
Returns MutableColor: The mutable color instance..
RibbonLayer::tint(ColorView)
Sets the vertex tint color of the ribbon.
| Parameter | Type | Description |
|---|---|---|
tint |
ColorView |
Tint color. |
Returns RibbonLayer: This instance for chaining..
RibbonLayer::width()
Returns the ribbon width in world units.
Returns float: The floating-point coordinate or dimension value..
RibbonLayer::width(float)
Sets the ribbon width in world units.
| Parameter | Type | Description |
|---|---|---|
width |
float |
Width dimension. |
Returns RibbonLayer: This instance for chaining..