Skip to content

Commit d33eec8

Browse files
committed
feat: Add graphics components and styles
- Introduced `Label` component for rendering text with customizable styles. - Added `Sprite` component for displaying images and image data. - Implemented `Shadow` effect class for creating drop shadows with customizable properties. - Created `CompositeOperation` type for managing different composite operations in graphics rendering. - Developed `Graphics` class to handle drawing operations, including labels, sprites, and shapes with various styles. - Established `GraphicsContext` as an abstract class for common canvas operations. - Added `SmoothingQuality` type for image smoothing settings. - Introduced line styles with `LineCap`, `LineJoin`, and `LineStyle` classes for customizable stroke styles. - Implemented text styles with `FontStyle` and `TextStyle` classes for managing font and text properties. - Updated tests to reflect new structure and imports for graphics components and styles.
1 parent ad92850 commit d33eec8

28 files changed

+44
-39
lines changed

src/core/assets/AssetLoader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { GameError } from "@/core/GameError";
22
import { AssetManifest } from "@/core/assets/AssetManifest";
33
import { AssetType, AudioAsset, StylesheetAsset, FontAsset, HtmlAsset, ImageAsset, JavaScriptAsset, JsonAsset, VideoAsset, XmlAsset } from "@/core/assets/Asset";
4-
import { Sprite } from "@/core/graphics/Sprite";
4+
import { Sprite } from "@/core/graphics/components/Sprite";
55
import { GameCoreService } from "@/core/service/GameCoreService";
66
import { EventSystem } from "@/core/events/EventSystem";
77
import { AssetStorage } from "@/core/assets/AssetStorage";

src/core/assets/AssetStorage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { AudioTrack } from "@/core/audio/AudioTrack";
2-
import { Sprite } from "@/core/graphics/Sprite";
2+
import { Sprite } from "@/core/graphics/components/Sprite";
33
import { GameError } from "@/core/GameError";
44
import { GameCoreService } from "@/core/service/GameCoreService";
55

src/core/assets/LoadableAssets.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { AudioTrack } from "@/core/audio/AudioTrack";
2-
import { Sprite } from "@/core/graphics/Sprite";
2+
import { Sprite } from "@/core/graphics/components/Sprite";
33

44
export interface LoadableAssets {
55
"image": Sprite;

src/core/graphics/Display.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { GameError } from "@/core/GameError";
22
import { Vector } from "@/core/math/geometry/Vector";
33
import { Dimension } from "@/core/math/geometry/Dimension";
4-
import { Graphics } from "@/core/graphics/Graphics";
4+
import { Graphics } from "@/core/graphics/rendering/Graphics";
55
import { DisplayOrientationType } from "@/core/graphics/DisplayOrientation";
66
import { GameCoreService } from "@/core/service/GameCoreService";
77

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { HEX, HSL, HWB, RGB, hex2rgb, hsl2hwb, hsl2rgb, hwb2hsl, rgb2hex, rgb2hsl } from "@/core/graphics/ColorSpaces";
1+
import { HEX, HSL, HWB, RGB, hex2rgb, hsl2hwb, hsl2rgb, hwb2hsl, rgb2hex, rgb2hsl } from "@/core/graphics/color/ColorSpaces";
22

33
type ColorSettings = HEX & RGB & HSL & HWB;
44

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Dimension } from "@/core/math/geometry/Dimension";
22
import { Vector } from "@/core/math/geometry/Vector";
3-
import { FontStyle } from "@/core/graphics/FontStyle";
4-
import { TextStyle } from "@/core/graphics/TextStyle";
3+
import { FontStyle } from "@/core/graphics/styles/text/FontStyle";
4+
import { TextStyle } from "@/core/graphics/styles/text/TextStyle";
55

66
export interface LabelSettings {
77
text: string;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Dimension } from "@/core/math/geometry/Dimension";
2-
import { Graphics } from "@/core/graphics/Graphics";
2+
import { Graphics } from "@/core/graphics/rendering/Graphics";
33

44
export class Sprite {
55
private dimension: Dimension;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Color } from "@/core/graphics/Color";
1+
import { Color } from "@/core/graphics/color/Color";
22

33
export interface ShadowSettings {
44
color?: Color;
File renamed without changes.

0 commit comments

Comments
 (0)