mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-28 15:04:15 +00:00
Render NameLayer text with MSDF assets
This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
||||
} from "../src/client/graphics/PlayerIcons";
|
||||
import {
|
||||
computeNameLayerLayout,
|
||||
computeNameLayerScreenMetrics,
|
||||
computeNameLayerWorldScale,
|
||||
computeTraitorFlashAlpha,
|
||||
computeTraitorFlashDurationSeconds,
|
||||
@@ -102,6 +103,17 @@ describe("NameLayerLayout", () => {
|
||||
expect(computeNameLayerWorldScale(20, 2)).toBeCloseTo(6);
|
||||
});
|
||||
|
||||
test("computes final screen-space text and icon sizes", () => {
|
||||
expect(computeNameLayerScreenMetrics(8, 2)).toEqual({
|
||||
fontSize: 16,
|
||||
iconSize: 24,
|
||||
});
|
||||
expect(computeNameLayerScreenMetrics(20, 2)).toEqual({
|
||||
fontSize: 48,
|
||||
iconSize: 72,
|
||||
});
|
||||
});
|
||||
|
||||
test("matches traitor flash duration thresholds and alpha extrema", () => {
|
||||
expect(computeTraitorFlashDurationSeconds(156)).toBeNull();
|
||||
expect(computeTraitorFlashDurationSeconds(150)).toBeCloseTo(1);
|
||||
|
||||
Reference in New Issue
Block a user