Added pivot point logic

This commit is contained in:
2025-02-15 16:39:39 +01:00
parent 2ce9bbdedd
commit 47be8597bf
6 changed files with 527 additions and 225 deletions

View File

@ -10,8 +10,11 @@ export class BaseMapObject extends BaseEntity {
@Property()
name!: string
@Property({ type: 'json', nullable: true })
tags?: any
@Property({ type: 'json' })
tags: string[] = []
@Property({ type: 'json' })
pivotPoints: { x: number; y: number; }[] = []
@Property({ type: 'decimal', precision: 10, scale: 2 })
originX = 0
@ -61,6 +64,15 @@ export class BaseMapObject extends BaseEntity {
return this.tags
}
setPivotPoints(pivotPoints: { x: number; y: number; }[]) {
this.pivotPoints = pivotPoints
return this
}
getPivotPoints() {
return this.pivotPoints
}
setOriginX(originX: number) {
this.originX = originX
return this