BiBorderedTriangle

ceramic.Entityceramic.Visualceramic.Meshelements.BiBorderedTriangle (Class)

A triangular shape with customizable border rendering.

This specialized mesh creates an upward-pointing triangle with a border that can have different colors and alpha values than the inner triangle. The triangle is rendered as a composite of two triangles - an inner filled triangle and an outer border triangle.

The vertex layout creates a larger outer triangle for the border and a smaller inner triangle for the fill, allowing for independent color control of each region.

Example usage:

var triangle = new BiBorderedTriangle();
triangle.size(100, 100);
triangle.innerColor = Color.BLUE;
triangle.borderColor = Color.WHITE;
triangle.borderSize = 2;

Instance Members

elements
innerColor: ceramic.Color

The color of the inner triangle fill. Defaults to Color.WHITE.


elements
innerAlpha: Float

The alpha transparency of the inner triangle fill. Values range from 0.0 (fully transparent) to 1.0 (fully opaque). Defaults to 1.0.


elements
borderSize: Float

The width of the border in pixels. The border extends outward from the triangle edges. Defaults to 1.0.


elements
borderColor: ceramic.Color

The color of the triangle border. Defaults to Color.BLACK.


elements
borderAlpha: Float

The alpha transparency of the triangle border. Values range from 0.0 (fully transparent) to 1.0 (fully opaque). Defaults to 1.0.


elements
computeContent(): Void

Recomputes the triangle mesh when properties change. Called automatically when width, height, or borderSize are modified.


elements
new(): Void

Creates a new BiBorderedTriangle instance.

The triangle is initialized with:

  • 6 vertices (3 for inner triangle, 3 for outer border triangle)
  • 5 triangle indices to form the border and fill regions
  • White inner color and gray border color
  • Color mapping set to INDICES for per-triangle coloring

Private Members

elements
updateVertices(): Void

Updates the vertex positions based on the current width, height, and borderSize.

The vertex layout is:

  • Vertices 0-2: Inner triangle (bottom-left, top-center, bottom-right)
  • Vertices 3-5: Outer border triangle (extended by borderSize)

The triangle points upward with its apex at the top center.

Metadata

Name Parameters
:build ceramic.macros.EntityMacro.buildForCompletion()
:autoBuild ceramic.macros.EntityMacro.buildForCompletion()
:build tracker.macros.EventsMacro.build()
:autoBuild tracker.macros.EventsMacro.build()