-
Notifications
You must be signed in to change notification settings - Fork 1
/
SpriteComponent.swift
47 lines (43 loc) · 999 Bytes
/
SpriteComponent.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//
// SpriteComponent.swift
// star-dash
//
// Created by Lau Rui han on 12/3/24.
//
import Foundation
class SpriteComponent: Component {
var image: String
var textureSet: TextureSet?
var textureAtlas: String?
var size: CGSize?
init(
id: ComponentId,
entityId: EntityId,
image: String,
textureSet: TextureSet?,
textureAtlas: String?,
size: CGSize?
) {
self.image = image
self.size = size
self.textureSet = textureSet
self.textureAtlas = textureAtlas
super.init(id: id, entityId: entityId)
}
convenience init(
entityId: EntityId,
image: String,
textureSet: TextureSet?,
textureAtlas: String?,
size: CGSize?
) {
self.init(
id: UUID(),
entityId: entityId,
image: image,
textureSet: textureSet,
textureAtlas: textureAtlas,
size: size
)
}
}