Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added files required for the example to work #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions example.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,13 @@

<body>

<p>Example Animation. Please ensure you've run anim_encoder.py to generate the required data.
<p>Example Animation. Please ensure you've run anim_encoder.py to generate the required data.</p>

<div><canvas id="anim_target" class="anim_target" width="800" height="450">
<canvas id="anim_target" class="anim_target" width="800" height="450"></canvas>
<div id="anim_fallback" class="anim_target" style="width: 800px; height: 450px; position: relative;"></div>
<p></canvas></div>

<script>
set_animation("example_packed.png", example_timeline, 'anim_target', 'anim_fallback');
set_animation("example_packed.png", example_timeline, 'anim_target', 'anim_fallback');
</script>

</body>
</body>
137 changes: 137 additions & 0 deletions example_anim.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
example_timeline = [{
"delay": 623,
"blit": [
[0, 0, 800, 450, 0, 0]
]
}, {
"delay": 182,
"blit": [
[0, 450, 322, 16, 182, 40],
[771, 482, 23, 10, 738, 96],
[720, 527, 23, 16, 244, 100],
[51, 526, 21, 16, 729, 128],
[586, 527, 20, 10, 738, 196],
[156, 513, 15, 28, 729, 234],
[720, 527, 23, 16, 181, 280],
[342, 528, 35, 8, 723, 316],
[720, 527, 23, 16, 307, 325],
[720, 527, 23, 16, 237, 385],
[608, 525, 112, 12, 4, 434]
]
}, {
"delay": 194,
"blit": [
[0, 526, 51, 15, 0, 100],
[777, 450, 23, 16, 244, 100],
[794, 488, 4, 2, 738, 104],
[608, 512, 112, 13, 4, 434]
]
}, {
"delay": 184,
"blit": [
[794, 486, 4, 2, 729, 128],
[105, 513, 51, 15, 0, 280],
[777, 450, 23, 16, 181, 280],
[608, 525, 7, 11, 4, 434]
]
}, {
"delay": 192,
"blit": [
[794, 484, 4, 2, 746, 134],
[720, 512, 51, 15, 0, 325],
[777, 450, 23, 16, 307, 325],
[788, 492, 7, 11, 4, 434]
]
}, {
"delay": 854,
"blit": [
[794, 482, 4, 2, 737, 142],
[720, 482, 51, 15, 0, 385],
[777, 450, 23, 16, 237, 385],
[171, 513, 7, 10, 4, 435]
]
}, {
"delay": 166,
"blit": [
[188, 498, 9, 8, 147, 16],
[300, 512, 112, 16, 391, 40],
[206, 528, 35, 10, 738, 96],
[0, 466, 224, 16, 244, 100],
[412, 527, 45, 16, 729, 128],
[771, 512, 28, 16, 181, 280],
[0, 482, 202, 16, 307, 325],
[771, 512, 28, 16, 237, 385]
]
}, {
"delay": 65,
"blit": [
[510, 512, 98, 15, 398, 40],
[309, 528, 33, 10, 739, 96],
[202, 497, 210, 15, 251, 100],
[543, 527, 43, 16, 730, 128],
[0, 498, 14, 15, 188, 280],
[0, 498, 188, 15, 314, 325],
[0, 498, 14, 15, 244, 385]
]
}, {
"delay": 174,
"blit": [
[188, 512, 112, 16, 391, 40],
[171, 528, 35, 10, 738, 96],
[553, 450, 224, 16, 244, 100],
[51, 526, 45, 16, 729, 128],
[433, 466, 28, 16, 181, 280],
[433, 466, 202, 16, 307, 325],
[433, 466, 28, 16, 237, 385]
]
}, {
"delay": 186,
"blit": [
[635, 466, 119, 16, 391, 40],
[96, 528, 36, 10, 738, 96],
[322, 450, 231, 16, 244, 100],
[754, 466, 46, 16, 729, 128],
[224, 466, 35, 16, 181, 280],
[224, 466, 209, 16, 307, 325],
[224, 466, 35, 16, 237, 385]
]
}, {
"delay": 50,
"blit": [
[412, 512, 98, 15, 419, 40],
[275, 528, 34, 10, 741, 96],
[412, 482, 210, 15, 272, 100],
[500, 527, 43, 16, 733, 128],
[600, 497, 14, 15, 209, 280],
[600, 497, 188, 15, 335, 325],
[600, 497, 14, 15, 265, 385]
]
}, {
"delay": 1419,
"blit": [
[622, 482, 98, 15, 426, 40],
[241, 528, 34, 10, 742, 96],
[202, 482, 210, 15, 279, 100],
[457, 527, 43, 16, 734, 128],
[412, 497, 14, 15, 216, 280],
[412, 497, 188, 15, 342, 325],
[412, 497, 14, 15, 272, 385]
]
}, {
"delay": 4000,
"blit": [
[0, 542, 343, 1, 182, 55],
[0, 100, 51, 15, 0, 100],
[265, 100, 1, 15, 286, 100],
[738, 196, 20, 10, 738, 196],
[729, 234, 15, 28, 729, 234],
[0, 280, 51, 15, 0, 280],
[265, 100, 1, 15, 223, 280],
[723, 316, 35, 8, 723, 316],
[0, 325, 51, 15, 0, 325],
[265, 100, 1, 15, 349, 325],
[0, 385, 51, 15, 0, 385],
[265, 100, 1, 15, 279, 385],
[0, 513, 105, 13, 4, 434]
]
}]
Binary file added example_packed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.