This repository has been archived by the owner on Nov 12, 2024. It is now read-only.
-
It gives me an error, saying that
Here's my JS file: import kaboom from "kaboom"
// initialize context
kaboom()
loadSpriteAtlas("sprites/arrows.png", "sprites/arrows.json");
drawSprite({"sprite": "arrowLeft", "pos": vec2(10, 10)}) And here's the {
"arrowLeft": {
"x": 0,
"y": 0,
"width": 32,
"height": 32
},
"arrowDown": {
"x": 32,
"y": 0,
"width": 32,
"height": 32
},
"arrowLeft": {
"x": 0,
"y": 32,
"width": 32,
"height": 32
},
"arrowTop": {
"x": 32,
"y": 32,
"width": 32,
"height": 32
},
"arrowAll": {
"x": 0,
"y": 64,
"width": 32,
"height": 32
},
"arrowSpace": {
"x": 32,
"y": 64,
"width": 32,
"height": 32
}
} But it still can't find it. What's going on here? EDIT: Never mind. Turns out I was doing it incorrectly. |
Beta Was this translation helpful? Give feedback.
Answered by
vercte
May 31, 2022
Replies: 1 comment
-
I had to load the sprite using import kaboom from "kaboom"
// initialize context
kaboom()
loadSpriteAtlas("sprites/arrows.png", "sprites/arrows.json")
let arrows = {
"left": add([
sprite("arrowLeft")
])
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
vercte
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I had to load the sprite using
sprite()
: