Skip to content

Commit

Permalink
Merge pull request #3 from defold/sprite-rotate-fix
Browse files Browse the repository at this point in the history
Changed rotation to CW to match regular Bob behaviour
  • Loading branch information
JCash committed Apr 29, 2024
2 parents 2869af2 + aff09d0 commit 21205e2
Show file tree
Hide file tree
Showing 15 changed files with 759 additions and 22 deletions.
Binary file added examples/rotate/a.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/rotate/b.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/rotate/c.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
286 changes: 286 additions & 0 deletions examples/rotate/rotate.collection
Original file line number Diff line number Diff line change
@@ -0,0 +1,286 @@
name: "rotate"
scale_along_z: 0
embedded_instances {
id: "go"
data: "embedded_components {\n"
" id: \"label\"\n"
" type: \"label\"\n"
" data: \"size {\\n"
" x: 128.0\\n"
" y: 32.0\\n"
" z: 0.0\\n"
" w: 0.0\\n"
"}\\n"
"color {\\n"
" x: 1.0\\n"
" y: 1.0\\n"
" z: 1.0\\n"
" w: 1.0\\n"
"}\\n"
"outline {\\n"
" x: 0.0\\n"
" y: 0.0\\n"
" z: 0.0\\n"
" w: 1.0\\n"
"}\\n"
"shadow {\\n"
" x: 0.0\\n"
" y: 0.0\\n"
" z: 0.0\\n"
" w: 1.0\\n"
"}\\n"
"leading: 1.0\\n"
"tracking: 0.0\\n"
"pivot: PIVOT_CENTER\\n"
"blend_mode: BLEND_MODE_ALPHA\\n"
"line_break: false\\n"
"text: \\\"Atlas\\\"\\n"
"font: \\\"/builtins/fonts/default.font\\\"\\n"
"material: \\\"/builtins/fonts/label-df.material\\\"\\n"
"\"\n"
" position {\n"
" x: 0.0\n"
" y: 256.0\n"
" z: 0.0\n"
" }\n"
" rotation {\n"
" x: 0.0\n"
" y: 0.0\n"
" z: 0.0\n"
" w: 1.0\n"
" }\n"
" scale {\n"
" x: 2.0\n"
" y: 2.0\n"
" z: 1.0\n"
" }\n"
"}\n"
"embedded_components {\n"
" id: \"a\"\n"
" type: \"sprite\"\n"
" data: \"default_animation: \\\"a\\\"\\n"
"material: \\\"/builtins/materials/sprite.material\\\"\\n"
"blend_mode: BLEND_MODE_ALPHA\\n"
"textures {\\n"
" sampler: \\\"texture_sampler\\\"\\n"
" texture: \\\"/examples/rotate/rotate_d.atlas\\\"\\n"
"}\\n"
"\"\n"
" position {\n"
" x: 0.0\n"
" y: 77.0\n"
" z: 0.0\n"
" }\n"
" rotation {\n"
" x: 0.0\n"
" y: 0.0\n"
" z: 0.0\n"
" w: 1.0\n"
" }\n"
"}\n"
"embedded_components {\n"
" id: \"b\"\n"
" type: \"sprite\"\n"
" data: \"default_animation: \\\"b\\\"\\n"
"material: \\\"/builtins/materials/sprite.material\\\"\\n"
"blend_mode: BLEND_MODE_ALPHA\\n"
"textures {\\n"
" sampler: \\\"texture_sampler\\\"\\n"
" texture: \\\"/examples/rotate/rotate_d.atlas\\\"\\n"
"}\\n"
"\"\n"
" position {\n"
" x: 0.0\n"
" y: -101.0\n"
" z: 0.0\n"
" }\n"
" rotation {\n"
" x: 0.0\n"
" y: 0.0\n"
" z: 0.0\n"
" w: 1.0\n"
" }\n"
"}\n"
"embedded_components {\n"
" id: \"c\"\n"
" type: \"sprite\"\n"
" data: \"default_animation: \\\"c\\\"\\n"
"material: \\\"/builtins/materials/sprite.material\\\"\\n"
"blend_mode: BLEND_MODE_ALPHA\\n"
"textures {\\n"
" sampler: \\\"texture_sampler\\\"\\n"
" texture: \\\"/examples/rotate/rotate_d.atlas\\\"\\n"
"}\\n"
"\"\n"
" position {\n"
" x: 0.0\n"
" y: -195.0\n"
" z: 0.0\n"
" }\n"
" rotation {\n"
" x: 0.0\n"
" y: 0.0\n"
" z: 0.0\n"
" w: 1.0\n"
" }\n"
"}\n"
""
position {
x: 179.0
y: 361.0
z: 0.0
}
rotation {
x: 0.0
y: 0.0
z: 0.0
w: 1.0
}
scale3 {
x: 1.0
y: 1.0
z: 1.0
}
}
embedded_instances {
id: "go1"
data: "embedded_components {\n"
" id: \"a\"\n"
" type: \"sprite\"\n"
" data: \"default_animation: \\\"a\\\"\\n"
"material: \\\"/builtins/materials/sprite.material\\\"\\n"
"blend_mode: BLEND_MODE_ALPHA\\n"
"textures {\\n"
" sampler: \\\"texture_sampler\\\"\\n"
" texture: \\\"/examples/rotate/rotate.tpatlas\\\"\\n"
"}\\n"
"\"\n"
" position {\n"
" x: 0.0\n"
" y: 77.0\n"
" z: 0.0\n"
" }\n"
" rotation {\n"
" x: 0.0\n"
" y: 0.0\n"
" z: 0.0\n"
" w: 1.0\n"
" }\n"
"}\n"
"embedded_components {\n"
" id: \"b\"\n"
" type: \"sprite\"\n"
" data: \"default_animation: \\\"b\\\"\\n"
"material: \\\"/builtins/materials/sprite.material\\\"\\n"
"blend_mode: BLEND_MODE_ALPHA\\n"
"textures {\\n"
" sampler: \\\"texture_sampler\\\"\\n"
" texture: \\\"/examples/rotate/rotate.tpatlas\\\"\\n"
"}\\n"
"\"\n"
" position {\n"
" x: 0.0\n"
" y: -101.0\n"
" z: 0.0\n"
" }\n"
" rotation {\n"
" x: 0.0\n"
" y: 0.0\n"
" z: 0.0\n"
" w: 1.0\n"
" }\n"
"}\n"
"embedded_components {\n"
" id: \"c\"\n"
" type: \"sprite\"\n"
" data: \"default_animation: \\\"c\\\"\\n"
"material: \\\"/builtins/materials/sprite.material\\\"\\n"
"blend_mode: BLEND_MODE_ALPHA\\n"
"textures {\\n"
" sampler: \\\"texture_sampler\\\"\\n"
" texture: \\\"/examples/rotate/rotate.tpatlas\\\"\\n"
"}\\n"
"\"\n"
" position {\n"
" x: 0.0\n"
" y: -195.0\n"
" z: 0.0\n"
" }\n"
" rotation {\n"
" x: 0.0\n"
" y: 0.0\n"
" z: 0.0\n"
" w: 1.0\n"
" }\n"
"}\n"
"embedded_components {\n"
" id: \"label\"\n"
" type: \"label\"\n"
" data: \"size {\\n"
" x: 128.0\\n"
" y: 32.0\\n"
" z: 0.0\\n"
" w: 0.0\\n"
"}\\n"
"color {\\n"
" x: 1.0\\n"
" y: 1.0\\n"
" z: 1.0\\n"
" w: 1.0\\n"
"}\\n"
"outline {\\n"
" x: 0.0\\n"
" y: 0.0\\n"
" z: 0.0\\n"
" w: 1.0\\n"
"}\\n"
"shadow {\\n"
" x: 0.0\\n"
" y: 0.0\\n"
" z: 0.0\\n"
" w: 1.0\\n"
"}\\n"
"leading: 1.0\\n"
"tracking: 0.0\\n"
"pivot: PIVOT_CENTER\\n"
"blend_mode: BLEND_MODE_ALPHA\\n"
"line_break: false\\n"
"text: \\\"TPAtlas\\\"\\n"
"font: \\\"/builtins/fonts/default.font\\\"\\n"
"material: \\\"/builtins/fonts/label-df.material\\\"\\n"
"\"\n"
" position {\n"
" x: 0.0\n"
" y: 256.0\n"
" z: 0.0\n"
" }\n"
" rotation {\n"
" x: 0.0\n"
" y: 0.0\n"
" z: 0.0\n"
" w: 1.0\n"
" }\n"
" scale {\n"
" x: 2.0\n"
" y: 2.0\n"
" z: 1.0\n"
" }\n"
"}\n"
""
position {
x: 461.0
y: 361.0
z: 0.0
}
rotation {
x: 0.0
y: 0.0
z: 0.0
w: 1.0
}
scale3 {
x: 1.0
y: 1.0
z: 1.0
}
}
Binary file added examples/rotate/rotate.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions examples/rotate/rotate.tpatlas
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
file: "/examples/rotate/rotate.tpinfo"
rename_patterns: ""
is_paged_atlas: false

0 comments on commit 21205e2

Please sign in to comment.