HomeModule plugins › AFM_Panel
Module

AFM_Panel

Builds a rounded panel mesh from corner, side and centre pieces at runtime, so 3D UI backing plates resize without new geometry.

What it gives you

  • Resizable 3D panels with constant corner radius
  • Border and fill colours driven from material parameters
  • A backing plate for world-space UI

Requires

None

Required by

AFE_Showroom AFS_UI

1 assets17 API members

Description

Scaling a panel mesh distorts its corners. BPC_Panel avoids that by building the panel from nine pieces — four corners, four sides and a centre — and repositioning them when the size changes, so corner radius stays constant at any dimension.

It is used as the backing plate behind world-space UI, and works equally well for physical panels in the scene.

Setup

  1. Enable AFM_Panel.
  2. Add BPC_Panel to your actor.
  3. Set Size, Thickness and the corner mesh — rounded or straight.
  4. Set Color Border and Color Base.

Usage

Resizing at runtime

Call DrawPanel or UpdateSize with the new size and pivot. The panel rebuilds its layout.

Matching your theme

Read colours from the active theme and pass them to UpdateColor.

The same panel at three sizes, corners preserved
AFM_Panel_sizes.pngThe same panel at three sizes, corners preserved
The same panel at three sizes, corners preserved

Key properties

PropertyWhen to change
SizePanel dimensions in world units
PivotWhich point the panel grows from
ThicknessBorder width
Mesh CornerRounded or straight corners

Extending

Supply your own centre, corner and side meshes through UpdateMeshes for a different panel style.

Performance notes

Performance

Each panel is nine mesh components. For many small panels, consider a single quad with a rounded-corner material instead.

Example map

Used as the backing for world-space UI throughout the Showroom.

Troubleshooting

Corners look stretched. The corner mesh is being scaled rather than repositioned — call UpdateSize rather than scaling the component.

API reference

Every blueprint asset in this plugin. Expand an asset to see its members.

Components

BPC_Panel17 members
extends SceneComponent
KindNameSignatureDescription
varMesh_CenterVisualStaticMeshMesh used for the flat centre section of the panel.
varMesh_CornerVisualStaticMeshMesh used for the four corners. Swap for the straight or rounded variant to change the panel silhouette.
varMesh_SideVisualStaticMeshMesh used for the four edge sections between the corners.
varPivotStateVector2DNormalised pivot of the panel, where 0.5, 0.5 centres it. Use this to grow the panel from an edge rather than the middle.
varSizeStateVector2DWidth and height of the panel in world units. Changing it rebuilds the mesh layout rather than stretching it, so corners keep their radius.
varThicknessStylefloatThickness of the panel border, in world units.
varMaterialVisualMaterialInterfaceMaterial applied to every panel section. Must expose the border and base colour parameters the panel drives.
varColor_BorderStyleLinearColorTint applied to the panel's border and frame pieces. This is the edge the user reads first, so keep it the stronger of the two colours.
varColor_BaseStyleLinearColorTint applied to the panel's background fill. Set it alongside the border colour so the two agree; both are pushed to the dynamic material when the panel is built.
fnCreateComponentsInit()Creates the nine mesh components that make up the panel. Called automatically when the panel is first drawn.
fnUpdateMeshesState(CenterMesh: StaticMesh, CornerMesh: StaticMesh, SideMesh: StaticMesh)Replaces the centre, corner and side meshes and rebuilds the panel.
fnUpdateSizeState(Size: Vector2D, Pivot: Vector2D)Resizes and re-pivots the panel, repositioning the sections so corner geometry is preserved.
fnCleanupForDestroyDestroy()Destroys the generated mesh components. Call before removing the panel to avoid leaving orphaned components.
fnUpdateOpacityState(Opacity: float)Sets the panel's opacity, for fading a backing plate in or out.
fnUpdateColorState(Color_Border: LinearColor, Color_Base: LinearColor)Sets the border and base colours together.
fngetMaterialInstanceMaterials(out MaterialInstance: MaterialInstanceDynamic)Returns the dynamic material instance shared by the panel sections, so extra parameters can be driven from outside.
eventDrawPanel(Size: Vector2D, Pivot: Vector2D)Builds or rebuilds the panel at the given size and pivot.