shroom icon indicating copy to clipboard operation
shroom copied to clipboard

Avatar onClick not dispatched when AvatarAction.Walk is enabled

Open sindreslungaard opened this issue 5 years ago • 0 comments

After update ^0.7, when you click on a part of the avatar except the head, the avatars onClick event is not dispatched.

Example:

let shroom = Shroom.create({ application: app, resourcePath: "./resources/flash" })

let room = Room.create(shroom, {
    tilemap: `
    xxxxxxxxx
    x00000000
    000000000
    x00000000
    xxxxxxxxx
    `,
})

let avatar = new Avatar({
    look: "hd-180-2.hr-100-61.ch-210-66.lg-270-81.sh-290-62",
    direction: 2,
    roomX: 1,
    roomY: 1,
    roomZ: 0,
})

avatar.onClick = () => {
    console.log("Avatar clicked")
}

avatar.addAction(AvatarAction.Move) // remove this line and onClick works as expected

room.addRoomObject(avatar)
app.stage.addChild(room)

sindreslungaard avatar Mar 03 '21 22:03 sindreslungaard