2.9.16
Coherent GT
A modern user interface library for games
Page auditing (auditor)

Coherent GT can audit HTML pages and check for suboptimal CSS and HTML usage. Coherent GT can automatically analyse your current UI and report what might be optimized.

Auditing jumpstart

The easiest way to use the auditor is to load your page in GTPlayer and click the Auditor button which will present the results as an overlay on top of your current page.

Integration in your engine

To issue an audit call the method Coherent::UIGT::View::AuditPerformance.

When called, Coherent::UIGT::View::AuditPerformance will inject a JavaScript script in your page, check for any problems and generate a report. If you pass true to the first argument of aforementioned method, a semi-transparent overlay will display the result and all faulty HTML elements will be highlighted with a pulsating red border.

If you want to convey the audit's report in some way you can override Coherent::UIGT::ViewListener::OnPerformanceAudit in your view listener.

Auditing list

Here are a few examples of some of the problems the auditor is able to detect:

  • Usage of popular JavaScript libraries with bad performance such as jQuery
  • Overuse of costly CSS properties such as filter, box-shadow and border-radius
  • Overuse of costly CSS to achieve effects that can be achieved without performance hits by using images (such as having round mask)
  • Too many elements of the same type that are unlikely to be used simultaneously