-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # spine-ts/package-lock.json # spine-ts/package.json # spine-ts/spine-canvas/package.json # spine-ts/spine-core/package.json # spine-ts/spine-phaser/package.json # spine-ts/spine-player/package.json # spine-ts/spine-threejs/package.json # spine-ts/spine-webgl/package.json
- Loading branch information
Showing
21 changed files
with
3,361 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
spine-ts/spine-phaser/example/basic-vanilla-js-example.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<script src="//cdn.jsdelivr.net/npm/phaser@3.55.2/dist/phaser.js"></script> | ||
<script src="https://unpkg.com/@esotericsoftware/spine-phaser@4.1.*/dist/iife/spine-phaser.min.js"></script> | ||
<title>Spine Phaser Example</title> | ||
</head> | ||
|
||
<body> | ||
<h1>Basic example</h1> | ||
</body> | ||
<script> | ||
var config = { | ||
type: Phaser.AUTO, | ||
width: 800, | ||
height: 600, | ||
type: Phaser.WEBGL, | ||
scene: { | ||
preload: preload, | ||
create: create, | ||
}, | ||
plugins: { | ||
scene: [ | ||
{ key: "spine.SpinePlugin", plugin: spine.SpinePlugin, mapping: "spine" } | ||
] | ||
} | ||
}; | ||
|
||
let game = new Phaser.Game(config); | ||
|
||
function preload() { | ||
this.load.spineBinary("spineboy-data", "assets/spineboy-pro.skel"); | ||
this.load.spineAtlas("spineboy-atlas", "assets/spineboy-pma.atlas"); | ||
} | ||
|
||
function create() { | ||
let spineboy = this.add.spine(400, 500, 'spineboy-data', "spineboy-atlas"); | ||
spineboy.scale = 0.5; | ||
spineboy.animationState.setAnimation(0, "walk", true); | ||
} | ||
</script> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# spine-phaser TypeScript | ||
Minimal example project using Phaser, spine-phaser, and TypeScript via NPM and [esbuild](https://esbuild.github.io/). | ||
|
||
1. Install dependencies: `npm install` | ||
2. Build bundle: `npm run build` | ||
3. Development (run server and recompile in watch mode): `npm run dev` |
102 changes: 102 additions & 0 deletions
102
spine-ts/spine-phaser/example/typescript/assets/spineboy-pma.atlas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
spineboy-pma.png | ||
size: 1024, 256 | ||
filter: Linear, Linear | ||
pma: true | ||
scale: 0.5 | ||
crosshair | ||
bounds: 813, 160, 45, 45 | ||
eye-indifferent | ||
bounds: 569, 2, 47, 45 | ||
eye-surprised | ||
bounds: 643, 7, 47, 45 | ||
rotate: 90 | ||
front-bracer | ||
bounds: 811, 51, 29, 40 | ||
front-fist-closed | ||
bounds: 807, 93, 38, 41 | ||
front-fist-open | ||
bounds: 815, 210, 43, 44 | ||
front-foot | ||
bounds: 706, 64, 63, 35 | ||
rotate: 90 | ||
front-shin | ||
bounds: 80, 11, 41, 92 | ||
front-thigh | ||
bounds: 754, 12, 23, 56 | ||
front-upper-arm | ||
bounds: 618, 5, 23, 49 | ||
goggles | ||
bounds: 214, 20, 131, 83 | ||
gun | ||
bounds: 347, 14, 105, 102 | ||
rotate: 90 | ||
head | ||
bounds: 80, 105, 136, 149 | ||
hoverboard-board | ||
bounds: 2, 8, 246, 76 | ||
rotate: 90 | ||
hoverboard-thruster | ||
bounds: 478, 2, 30, 32 | ||
hoverglow-small | ||
bounds: 218, 117, 137, 38 | ||
rotate: 90 | ||
mouth-grind | ||
bounds: 775, 80, 47, 30 | ||
rotate: 90 | ||
mouth-oooo | ||
bounds: 779, 31, 47, 30 | ||
rotate: 90 | ||
mouth-smile | ||
bounds: 783, 207, 47, 30 | ||
rotate: 90 | ||
muzzle-glow | ||
bounds: 779, 4, 25, 25 | ||
muzzle-ring | ||
bounds: 451, 14, 25, 105 | ||
muzzle01 | ||
bounds: 664, 60, 67, 40 | ||
rotate: 90 | ||
muzzle02 | ||
bounds: 580, 56, 68, 42 | ||
rotate: 90 | ||
muzzle03 | ||
bounds: 478, 36, 83, 53 | ||
rotate: 90 | ||
muzzle04 | ||
bounds: 533, 49, 75, 45 | ||
rotate: 90 | ||
muzzle05 | ||
bounds: 624, 56, 68, 38 | ||
rotate: 90 | ||
neck | ||
bounds: 806, 8, 18, 21 | ||
portal-bg | ||
bounds: 258, 121, 133, 133 | ||
portal-flare1 | ||
bounds: 690, 2, 56, 30 | ||
rotate: 90 | ||
portal-flare2 | ||
bounds: 510, 3, 57, 31 | ||
portal-flare3 | ||
bounds: 722, 4, 58, 30 | ||
rotate: 90 | ||
portal-shade | ||
bounds: 393, 121, 133, 133 | ||
portal-streaks1 | ||
bounds: 528, 126, 126, 128 | ||
portal-streaks2 | ||
bounds: 656, 129, 125, 125 | ||
rear-bracer | ||
bounds: 826, 13, 28, 36 | ||
rear-foot | ||
bounds: 743, 70, 57, 30 | ||
rotate: 90 | ||
rear-shin | ||
bounds: 174, 14, 38, 89 | ||
rear-thigh | ||
bounds: 783, 158, 28, 47 | ||
rear-upper-arm | ||
bounds: 783, 136, 20, 44 | ||
rotate: 90 | ||
torso | ||
bounds: 123, 13, 49, 90 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset='utf-8'> | ||
<meta http-equiv='X-UA-Compatible' content='IE=edge'> | ||
<title>Page Title</title> | ||
<meta name='viewport' content='width=device-width, initial-scale=1'> | ||
<script src='build/index.js'></script> | ||
</head> | ||
<body> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import {Scene} from "phaser" | ||
import {SpinePlugin} from "@esotericsoftware/spine-phaser" | ||
|
||
class SpineDemo extends Scene { | ||
preload() { | ||
this.load.spineBinary("spineboy-data", "assets/spineboy-pro.skel"); | ||
this.load.spineAtlas("spineboy-atlas", "assets/spineboy-pma.atlas"); | ||
} | ||
|
||
create() { | ||
let spineboy = this.add.spine(400, 500, 'spineboy-data', "spineboy-atlas"); | ||
this.make | ||
spineboy.scale = 0.5; | ||
spineboy.animationState.setAnimation(0, "walk", true); | ||
} | ||
} | ||
|
||
var config = { | ||
width: 800, | ||
height: 600, | ||
type: Phaser.WEBGL, | ||
scene: [SpineDemo], | ||
plugins: { | ||
scene: [ | ||
{ key: "spine.SpinePlugin", plugin: SpinePlugin, mapping: "spine" } | ||
] | ||
} | ||
}; | ||
|
||
let game = new Phaser.Game(config); |
Oops, something went wrong.