-
Notifications
You must be signed in to change notification settings - Fork 0
Outline Styles
OutlineStyle controls how Butterfly API outlines are rendered.
A style can configure:
- Color
- Thickness
- Placement
- Black border
- Visibility through walls
- Model-layer matching
- Distance-consistent thickness
The simplest style can be created with:
OutlineStyle style =
OutlineStyle.of("#FFFFFF");You can also use the builder for more control:
OutlineStyle style =
OutlineStyle.builder("#FFFFFF")
.thickness(2)
.placement(
OutlinePlacement.CENTERED
)
.blackBorder(false)
.visibleThroughWalls(true)
.matchModelLayer(true)
.consistentThickness(true)
.build();Outline colors use RGB values.
Hex strings can be used:
OutlineStyle.of("#FFFFFF");Colors can also be represented as RGB integers:
0xFFFFFF
Set outline thickness with:
.thickness(2)Thickness is measured in pixels.
Valid thickness values are:
1 - 63
Outline placement controls where the outline expands relative to the rendered shape.
Available placements are:
OutlinePlacement.CENTERED
OutlinePlacement.OUTSIDE
OutlinePlacement.INSIDEExample:
.placement(
OutlinePlacement.OUTSIDE
)Enable a black border with:
.blackBorder(true)When black borders are enabled, supported outline thickness is limited to:
22 pixels
Use:
.visibleThroughWalls(true)when the outline should remain visible through depth.
Disable it with:
.visibleThroughWalls(false)when normal depth should hide the outline.
Use:
.matchModelLayer(true)when an outline mask should follow the source renderer's model layer.
This is especially useful for cutout or translucent rendering.
Example:
OutlineStyle style =
OutlineStyle.builder("#FFFFFF")
.matchModelLayer(true)
.build();Use:
.consistentThickness(true)to keep the requested outline width visually stable across distance.
OutlineStyle questStyle =
OutlineStyle.builder("#66CCFF")
.thickness(3)
.placement(
OutlinePlacement.OUTSIDE
)
.blackBorder(false)
.visibleThroughWalls(true)
.matchModelLayer(true)
.consistentThickness(true)
.build();This style can then be used with either server or client outlines.