-
Notifications
You must be signed in to change notification settings - Fork 0
Working with Sprite
bapquad edited this page Feb 20, 2022
·
4 revisions
[Home] > Working with Sprite
This content we learn how to work with a sprite.
You can create the sprite animation with the motion5
package.
import {element5 as $, motion5} from '@bapquad/element5'
let number = motion5.Sprite(100, 100, "number.png");
You need the DOM element to role the playback for the animation.
let player = $.create("p#number").motion(number);
Now, the animation will play on the "Play" button clicked.
let playBtn = $.create("button").text("Play").on("click", () => {
player.MotionSprite.Run();
});
Bapquad Games since 2015
- Get Started
- Working with DOM
- Constructing the StyleSheet
- Working with Sprite
- Working with Timeline
- Working with Scroller
- Working with Camera
- Working with Microphone
- Making the Ajax Request
- Opening a Websocket
- Working with Storage
- Checking User Agent
- Working with GPS
- Working with Router
- Playing the Stream