Player12
An open source football management simulator
Loading...
Searching...
No Matches
match_renderer_2d.h File Reference
#include <imgui.h>
#include <memory>
#include "gui/render/imatch_renderer.h"
#include "gui/render/match_kit_colors.h"
#include "gui/scenes/match_scene_tuning.h"

Go to the source code of this file.

Classes

class  MatchRenderer2D
 

Functions

MatchViewport computeMatchViewport (float topLeftX, float topLeftY, float availableWidth, float availableHeight)
 
const char * playerIntentLabel (PlayerIntent intent)
 
void drawGoalCelebration (ImDrawList &drawList, const MatchViewport &viewport, int homeScore, int awayScore, float celebrationRemaining, float celebrationDuration)
 

Function Documentation

◆ computeMatchViewport()

MatchViewport computeMatchViewport ( float  topLeftX,
float  topLeftY,
float  availableWidth,
float  availableHeight 
)

Fits the pitch into the available screen space at its real 105 x 68 m proportions (never stretched); the caller centres the result.

◆ drawGoalCelebration()

void drawGoalCelebration ( ImDrawList &  drawList,
const MatchViewport &  viewport,
int  homeScore,
int  awayScore,
float  celebrationRemaining,
float  celebrationDuration 
)

Goal flash and banner centred on the viewport; shared by both views.

◆ playerIntentLabel()

const char * playerIntentLabel ( PlayerIntent  intent)

Short English description of a player's current intent (tooltips).