Well, you can use PixiJS to display images on the map.
Currently I'm thinking about using events
On the server side, you can create a dynamic event on the map. I put a name starting with nft-
@EventData({
name: 'nft-test'
})
class NFT extends RpgEvent {}
map.createDynamicEvent({
event: NFT,
x: 10,
y: 10
})
Client side
import { RpgSprite, RpgSpriteHooks } from '@rpgjs/client'
export const sprite: RpgSpriteHooks = {
onInit(sprite: RpgSprite) {
const data: any = sprite.logic
if (data.name && data.name.startsWith('nft')) {
const texture = PIXI.Texture.from('https://picsum.photos/200/300')
const image = new PIXI.Sprite(texture)
sprite.addChild(image)
}
}
}
I'm going to bring a reflection on the display of images in the game. Even though the event is interesting, it uses way too much property unnecessarily.