Send frameCount for assets to client

This commit is contained in:
Dennis Postma 2024-09-28 00:59:20 +02:00
parent 6f057639c0
commit cc9eada654
2 changed files with 2 additions and 0 deletions

View File

@ -30,6 +30,7 @@ async function addHttpRoutes(app: Application) {
key: sprite.id + '-' + spriteAction.action, key: sprite.id + '-' + spriteAction.action,
url: '/assets/sprites/' + sprite.id + '/' + spriteAction.action + '.png', url: '/assets/sprites/' + sprite.id + '/' + spriteAction.action + '.png',
group: spriteAction.isAnimated ? 'sprite_animations' : 'sprites', group: spriteAction.isAnimated ? 'sprite_animations' : 'sprites',
frameCount: JSON.parse(JSON.stringify(spriteAction.sprites)).length,
frameWidth: spriteAction.frameWidth, frameWidth: spriteAction.frameWidth,
frameHeight: spriteAction.frameHeight frameHeight: spriteAction.frameHeight
}) })

View File

@ -25,6 +25,7 @@ export type TAsset = {
key: string key: string
url: string url: string
group: 'tiles' | 'objects' | 'sprites' | 'sprite_animations' | 'sound' | 'music' | 'ui' | 'font' | 'other' group: 'tiles' | 'objects' | 'sprites' | 'sprite_animations' | 'sound' | 'music' | 'ui' | 'font' | 'other'
frameCount?: number
frameWidth?: number frameWidth?: number
frameHeight?: number frameHeight?: number
} }