ULCKStepper
Increment/decrement control for numerical values like FOV, distance, and smoothness.
Properties
Property Type Description bUseDecimalsboolShow decimal values in display
Events
Broadcast when value changes. DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam (FOnStepperValueChanged, int8, NewValue);
Parameter Type Description NewValueint8Direction: -1 (decrease), +1 (increase)
Methods
Method Description Increment()Increase value by one step Decrement()Decrease value by one step UpdateCounterText(Value)Update displayed value text
Derived Classes
ULCKFOVButton Field of view adjustment
ULCKDistanceButton Camera distance control
ULCKSmoothnessButton Camera smoothness adjustment
Example
ULCKStepper * FOVStepper = CreateDefaultSubobject < ULCKStepper >( TEXT ( "FOVStepper" ));
FOVStepper -> bUseDecimals = false ;
FOVStepper -> OnStepperValueChanged . AddDynamic ( this , & AMyActor ::OnFOVChanged);
void AMyActor :: OnFOVChanged ( int8 Direction )
{
// Direction is -1 or +1
CurrentFOV = FMath :: Clamp (CurrentFOV + Direction * 5.0 f , 60.0 f , 120.0 f );
Camera -> SetFieldOfView (CurrentFOV);
FOVStepper -> UpdateCounterText (CurrentFOV);
}
ULCKPad2D
2D directional pad for camera or value control with 8-way input.
Events
Broadcast when direction changes. DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam (FOnPad2DChanged, FIntPoint, NewValue);
Parameter Type Description NewValueFIntPointDirection as (X, Y) where values are -1, 0, or 1
Example
ULCKPad2D * CameraPad = CreateDefaultSubobject < ULCKPad2D >( TEXT ( "CameraPad" ));
CameraPad -> OnPad2DChanged . AddDynamic ( this , & AMyActor ::OnPadChanged);
void AMyActor :: OnPadChanged ( FIntPoint Direction )
{
// Direction.X: -1 (left), 0 (center), +1 (right)
// Direction.Y: -1 (down), 0 (center), +1 (up)
FVector Movement = FVector ( Direction . Y , Direction . X , 0 ) * MoveSpeed;
Camera -> AddLocalOffset (Movement);
}
ULCKDisplay
Render target display surface with overlay effects for camera preview.
Methods
Method Parameters Description SetScreenOrientationELCKScreenOrientationSet landscape/portrait SetScreenRenderTextureUTextureRenderTarget2D*Set source render target SetOverlayFactorfloat (0-1)Set overlay intensity SetFlashFactorfloat (0-1)Set flash intensity SetFlashColorFColorSet flash color SetShowNotificationFactorfloat (0-1)Set notification visibility SetUVOffsetFVector2DSet UV coordinates SetTextLabelVisibilityboolShow/hide text label AddTextLineconst FString&Add text line to display ClearTextLines- Clear all text lines
Example
ULCKDisplay * Display = CreateDefaultSubobject < ULCKDisplay >( TEXT ( "Display" ));
// Connect to scene capture
Display -> SetScreenRenderTexture ( SceneCapture -> TextureTarget );
// Set orientation
Display -> SetScreenOrientation ( ELCKScreenOrientation ::Landscape);
// Flash effect for photo capture
void AMyActor :: OnPhotoTaken ()
{
Display -> SetFlashColor ( FColor ::White);
Display -> SetFlashFactor ( 1.0 f );
// Fade out flash
GetWorld ()-> GetTimerManager (). SetTimer (FlashTimer, [ this ]() {
float CurrentFlash = Display -> GetFlashFactor ();
if (CurrentFlash > 0 )
{
Display -> SetFlashFactor (CurrentFlash - 0.1 f );
}
}, 0.05 f , true );
}
ULCKShowablesGroup
Container for managing multiple showable components together.
Interfaces
Implements ILCKShowable.
Methods
Method Description Show()Show all contained showables Hide()Hide all contained showables Add(NewShowable)Add a showable to the group SetUIActive(bIsActive)Batch enable/disable UI
Example
// Create group for camera settings UI
ULCKShowablesGroup * CameraSettings = NewObject < ULCKShowablesGroup >( this );
CameraSettings -> Add (FOVButton);
CameraSettings -> Add (DistanceButton);
CameraSettings -> Add (SmoothnessButton);
// Show all when entering settings mode
void AMyActor :: EnterSettingsMode ()
{
CameraSettings -> Show ();
}
// Hide all when exiting settings mode
void AMyActor :: ExitSettingsMode ()
{
CameraSettings -> Hide ();
}
Use ULCKShowablesGroup to manage related UI elements together, reducing complexity in show/hide logic.
UI System Integration
ILCKUISystemable
Interface for UI system interaction coordination.
class ILCKUISystemable
{
public:
virtual void SetCurrentOperatingButton ( ILCKButtonable * InButtonable ) = 0 ;
virtual void PlayUIFeedback ( bool InIsOnPressed , FVector NewTouchLocation ) = 0 ;
virtual bool IsCurrentOperatingButtonNull () = 0 ;
virtual bool IsValidInteractor ( UPrimitiveComponent * InInteractorComp ) = 0 ;
virtual bool CanBePressed ( ILCKButtonable * InButtonable ) = 0 ;
};
This interface allows UI components to coordinate with a central UI system for:
Preventing multiple simultaneous button presses
Playing haptic/audio feedback
Validating interactor components (e.g., specific hand or pointer)
Collision Setup
UI components use a specific collision profile for VR hand/pointer interaction:
// Set up collision for UI interaction
CollisionBox -> SetCollisionProfileName ( FLCKConstants ::UICollisionProfileName);
// Default profile: "OverlapOnlyPawn"
Ensure your project has the “OverlapOnlyPawn” collision profile configured, or update FLCKConstants::UICollisionProfileName to match your project’s collision setup.