panda3d.core.FrameRateMeter

class FrameRateMeter

Bases: TextNode

This is a special TextNode that automatically updates itself with the current frame rate. It can be placed anywhere in the world where you’d like to see the frame rate.

It also has a special mode in which it may be attached directly to a channel or window. If this is done, it creates a DisplayRegion for itself and renders itself in the upper-right-hand corner.

Inheritance diagram

Inheritance diagram of FrameRateMeter

__init__(param0: FrameRateMeter) → None
__init__(name: str) → None
setupWindow(window: GraphicsOutput) → None

Sets up the frame rate meter to create a DisplayRegion to render itself into the indicated window.

clearWindow() → None

Undoes the effect of a previous call to setupWindow().

getWindow() → GraphicsOutput

Returns the GraphicsOutput that was passed to setupWindow(), or NULL if setupWindow() has not been called.

Return type

GraphicsOutput

getDisplayRegion() → DisplayRegion

Returns the DisplayRegion that the meter has created to render itself into the window to setupWindow(), or NULL if setupWindow() has not been called.

Return type

DisplayRegion

setUpdateInterval(update_interval: float) → None

Specifies the number of seconds that should elapse between updates to the frame rate indication. This should be reasonably slow (e.g. 0.2 to 1.0) so that the calculation of the frame rate text does not itself dominate the frame rate.

getUpdateInterval() → float

Returns the number of seconds that will elapse between updates to the frame rate indication.

setTextPattern(text_pattern: str) → None

Sets the sprintf() pattern that is used to format the text. The string “%f” or some variant will be replaced with the current frame rate in frames per second.

getTextPattern() → str

Returns the sprintf() pattern that is used to format the text.

setClockObject(clock_object: ClockObject) → None

Sets the clock that is used to determine the frame rate. The default is the application’s global clock (ClockObject.getGlobalClock()).

getClockObject() → ClockObject

Returns the clock that is used to determine the frame rate.

Return type

ClockObject

update() → None

You can call this to explicitly force the FrameRateMeter to update itself with the latest frame rate information. Normally, it is not necessary to call this explicitly.

static getClassType() → TypeHandle
Return type

TypeHandle