Keyboard Move Sprite #19
-
I'm enjoying svelte-pixi a lot, I got Spine sprites working on it too which is a big plus. I saw the click and drag sprite example and I'm trying to reference it to use keyboard movement. Looking at the api I see "click, mousedown, tap, touchstart, etc" but not anything for a keyboard. What am I missing here? Thanks for the help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @josiahdowdy, glad you are enjoying it! Pixi.js doesn't offer anything for handling keyboard events, but you can set up a listener on the window for |
Beta Was this translation helpful? Give feedback.
Hey @josiahdowdy, glad you are enjoying it!
Pixi.js doesn't offer anything for handling keyboard events, but you can set up a listener on the window for
keydown
or similar in your Svelte components. The events emitted from the SveltePixi components are directly forwarded from the underlying Pixi.js instance, which largely only includes mouse/pointer-based events.