VISU - PHP Game Framework

FUIPerformanceTracerOverlay extends FUIView
in package

Table of Contents

Properties

$captureKey  : int
Key Binding for capture/freeze tracing
$children  : array<string|int, FUIView>
An array of child views
$homeKey  : int
Key Binding for home
$nextViewModeKey  : int
Key Binding to switch to the next view mode
$padding  : Vec4
Padding is represented as a Vec4 x = left padding y = right padding z = top padding w = bottom padding
$pageDownKey  : int
Key Binding for page down
$pageUpKey  : int
Key Binding for page up
$scrollDownKey  : int
Key Binding for scrolling down
$scrollUpKey  : int
Key Binding for scrolling up
$toggleKey  : int
Key Binding to toggle the overlay
$toggleMethodsKey  : int
Key Binding to toggle method visibility inside the tree view
$backgroundColor  : VGColor
Background color for the overlay
$borderColor  : VGColor
Border color for the overlay
$isFrozen  : bool
Whether tracing is currently frozen (captured)
$lineHeight  : float
Height of each line in scrollable views
$maxTraces  : int
Maximum number of traces to keep in memory
$scrollOffset  : float
Current scroll offset for scrollable views
$showMethods  : bool
Whether to display individual methods inside the tree view
$textColor  : VGColor
Text color for the overlay
$traces  : array<string|int, FUIPerformanceTrace>
Array of collected performance traces
$viewMode  : string
Current view mode
$viewModes  : array<string|int, string>
Available view modes

Methods

__construct()  : mixed
Constructor
addTrace()  : void
Add a performance trace to the collection
clearTraces()  : void
Clear all collected traces
getEstimatedSize()  : Vec2
Calculate estimated size for the overlay
getHelpText()  : string
Get help text for the current view mode
getLatestTrace()  : FUIPerformanceTrace|null
Get the latest trace
getTraceCount()  : int
Get the number of collected traces
getViewMode()  : string
Get the current view mode
handleKeyPress()  : bool
Handle keyboard input for the overlay
isFrozen()  : bool
Check if tracing is currently frozen
nextViewMode()  : void
Switch to the next view mode
padding()  : self
Sets the views padding Padding is the space inside the view to its content
paddingAll()  : self
Sets all padding values to the same value Padding is the space inside the view to its content
paddingBottom()  : self
Sets the views bottom padding Padding is the space inside the view to its content
paddingFull()  : self
Sets the views padding with individual values Padding is the space inside the view to its content
paddingLeft()  : self
Sets the views left padding Padding is the space inside the view to its content
paddingRight()  : self
Sets the views right padding Padding is the space inside the view to its content
paddingTop()  : self
Sets the views top padding Padding is the space inside the view to its content
paddingX()  : self
Sets the views horizontal padding (left and right) Padding is the space inside the view to its content
paddingY()  : self
Sets the views vertical padding (top and bottom) Padding is the space inside the view to its content
previousViewMode()  : void
Switch to the previous view mode
render()  : void
Render the overlay
scroll()  : void
Scroll the view by the given amount
setColors()  : void
Set overlay colors
setFrozen()  : void
Set the frozen state of tracing
setKeybindings()  : void
Configure all keybindings for the overlay
setMaxTraces()  : void
Set the maximum number of traces to keep
setViewMode()  : void
Set the view mode
toggleFrozen()  : void
Toggle the frozen state of tracing
drawAxes()  : void
Draw axes and labels for the performance graph
drawDataPoints()  : void
Draw data points for recent samples
drawGrid()  : void
Draw background grid for the performance graph
drawLegend()  : void
Draw legend for the performance graph
drawPerformanceLines()  : void
Draw the performance data lines
drawThresholdLines()  : void
Draw performance threshold indicator lines
getAverageMetrics()  : array{totalTime: float, totalViews: float, renderCalls: float, count: int}
Calculate average performance metrics across all traces
renderHistoryContent()  : void
Render history content as a performance graph
renderHistoryView()  : void
Render the history view (list of all traces)
renderNoDataMessage()  : void
Render a message when no data is available
renderSummaryView()  : void
Render the summary view (small bar at bottom)
renderTreeContent()  : void
Render tree content
renderTreeView()  : void
Render the tree view (detailed overlay)

Properties

$children

An array of child views

public array<string|int, FUIView> $children = []

$padding

Padding is represented as a Vec4 x = left padding y = right padding z = top padding w = bottom padding

public Vec4 $padding

$toggleMethodsKey

Key Binding to toggle method visibility inside the tree view

public int $toggleMethodsKey = \VISU\OS\Key::M

Methods

handleKeyPress()

Handle keyboard input for the overlay

public handleKeyPress(int $key) : bool
Parameters
$key : int
Return values
bool

padding()

Sets the views padding Padding is the space inside the view to its content

public padding(float $horizontal, float $vertical) : self
Parameters
$horizontal : float
$vertical : float
Return values
self

paddingAll()

Sets all padding values to the same value Padding is the space inside the view to its content

public paddingAll(float $padding) : self
Parameters
$padding : float
Return values
self

paddingBottom()

Sets the views bottom padding Padding is the space inside the view to its content

public paddingBottom(float $paddingBottom) : self
Parameters
$paddingBottom : float
Return values
self

paddingFull()

Sets the views padding with individual values Padding is the space inside the view to its content

public paddingFull(float $left, float $right, float $top, float $bottom) : self
Parameters
$left : float
$right : float
$top : float
$bottom : float
Return values
self

paddingLeft()

Sets the views left padding Padding is the space inside the view to its content

public paddingLeft(float $paddingLeft) : self
Parameters
$paddingLeft : float
Return values
self

paddingRight()

Sets the views right padding Padding is the space inside the view to its content

public paddingRight(float $paddingRight) : self
Parameters
$paddingRight : float
Return values
self

paddingTop()

Sets the views top padding Padding is the space inside the view to its content

public paddingTop(float $paddingTop) : self
Parameters
$paddingTop : float
Return values
self

paddingX()

Sets the views horizontal padding (left and right) Padding is the space inside the view to its content

public paddingX(float $paddingX) : self
Parameters
$paddingX : float
Return values
self

paddingY()

Sets the views vertical padding (top and bottom) Padding is the space inside the view to its content

public paddingY(float $paddingY) : self
Parameters
$paddingY : float
Return values
self

setColors()

Set overlay colors

public setColors(VGColor $background, VGColor $border, VGColor $text) : void
Parameters
$background : VGColor
$border : VGColor
$text : VGColor

setKeybindings()

Configure all keybindings for the overlay

public setKeybindings([int $toggleKey = Key::F6 ][, int $nextViewModeKey = Key::TAB ][, int $scrollUpKey = Key::UP ][, int $scrollDownKey = Key::DOWN ][, int $pageUpKey = Key::PAGE_UP ][, int $pageDownKey = Key::PAGE_DOWN ][, int $homeKey = Key::HOME ][, int $captureKey = Key::C ][, int $toggleMethodsKey = Key::M ]) : void
Parameters
$toggleKey : int = Key::F6
$nextViewModeKey : int = Key::TAB
$scrollUpKey : int = Key::UP
$scrollDownKey : int = Key::DOWN
$pageUpKey : int = Key::PAGE_UP
$pageDownKey : int = Key::PAGE_DOWN
$homeKey : int = Key::HOME
$captureKey : int = Key::C
$toggleMethodsKey : int = Key::M

setMaxTraces()

Set the maximum number of traces to keep

public setMaxTraces(int $maxTraces) : void
Parameters
$maxTraces : int

drawAxes()

Draw axes and labels for the performance graph

private drawAxes(FUIRenderContext $ctx, float $x, float $y, float $width, float $height, float $graphX, float $graphY, float $graphWidth, float $graphHeight, float $maxTime) : void
Parameters
$ctx : FUIRenderContext
$x : float
$y : float
$width : float
$height : float
$graphX : float
$graphY : float
$graphWidth : float
$graphHeight : float
$maxTime : float

drawDataPoints()

Draw data points for recent samples

private drawDataPoints(FUIRenderContext $ctx, float $x, float $y, float $width, float $height, float $maxTime) : void
Parameters
$ctx : FUIRenderContext
$x : float
$y : float
$width : float
$height : float
$maxTime : float

drawGrid()

Draw background grid for the performance graph

private drawGrid(FUIRenderContext $ctx, float $x, float $y, float $width, float $height, float $maxTime) : void
Parameters
$ctx : FUIRenderContext
$x : float
$y : float
$width : float
$height : float
$maxTime : float

drawPerformanceLines()

Draw the performance data lines

private drawPerformanceLines(FUIRenderContext $ctx, float $x, float $y, float $width, float $height, float $maxTime) : void
Parameters
$ctx : FUIRenderContext
$x : float
$y : float
$width : float
$height : float
$maxTime : float

drawThresholdLines()

Draw performance threshold indicator lines

private drawThresholdLines(FUIRenderContext $ctx, float $x, float $y, float $width, float $height, float $maxTime) : void
Parameters
$ctx : FUIRenderContext
$x : float
$y : float
$width : float
$height : float
$maxTime : float

getAverageMetrics()

Calculate average performance metrics across all traces

private getAverageMetrics() : array{totalTime: float, totalViews: float, renderCalls: float, count: int}
Return values
array{totalTime: float, totalViews: float, renderCalls: float, count: int}

        
On this page

Search results