Browse Source

[ts][webgl] Add viewport meta to examples.

Mario Zechner 1 year ago
parent
commit
7a253b49ab

+ 5 - 0
spine-ts/spine-webgl/example/barebones-dragon.html

@@ -1,4 +1,9 @@
+<!DOCTYPE html>
 <html>
 <html>
+<head>
+	<meta charset="UTF-8">
+	<meta name="viewport" content="width=device-width, initial-scale=1.0">
+</head>
 <script src="../dist/iife/spine-webgl.js"></script>
 <script src="../dist/iife/spine-webgl.js"></script>
 <style>
 <style>
 	* {
 	* {

+ 5 - 0
spine-ts/spine-webgl/example/barebones.html

@@ -1,4 +1,9 @@
+<!DOCTYPE html>
 <html>
 <html>
+<head>
+	<meta charset="UTF-8">
+	<meta name="viewport" content="width=device-width, initial-scale=1.0">
+</head>
 <script src="../dist/iife/spine-webgl.js"></script>
 <script src="../dist/iife/spine-webgl.js"></script>
 <style>
 <style>
 	* {
 	* {

+ 5 - 0
spine-ts/spine-webgl/example/bone-dragging.html

@@ -1,4 +1,9 @@
+<!DOCTYPE html>
 <html>
 <html>
+<head>
+	<meta charset="UTF-8">
+	<meta name="viewport" content="width=device-width, initial-scale=1.0">
+</head>
 <script src="../dist/iife/spine-webgl.js"></script>
 <script src="../dist/iife/spine-webgl.js"></script>
 <style>
 <style>
 	* {
 	* {

+ 5 - 0
spine-ts/spine-webgl/example/custom-attachment.html

@@ -1,4 +1,9 @@
+<!DOCTYPE html>
 <html>
 <html>
+<head>
+	<meta charset="UTF-8">
+	<meta name="viewport" content="width=device-width, initial-scale=1.0">
+</head>
 <script src="../dist/iife/spine-webgl.js"></script>
 <script src="../dist/iife/spine-webgl.js"></script>
 <style>
 <style>
 	* {
 	* {

+ 5 - 0
spine-ts/spine-webgl/example/drag-and-drop.html

@@ -1,4 +1,9 @@
+<!DOCTYPE html>
 <html>
 <html>
+<head>
+	<meta charset="UTF-8">
+	<meta name="viewport" content="width=device-width, initial-scale=1.0">
+</head>
   <script src="../dist/iife/spine-webgl.js"></script>
   <script src="../dist/iife/spine-webgl.js"></script>
   <style>
   <style>
     * {
     * {

+ 5 - 0
spine-ts/spine-webgl/example/dress-up.html

@@ -1,4 +1,9 @@
+<!DOCTYPE html>
 <html>
 <html>
+<head>
+	<meta charset="UTF-8">
+	<meta name="viewport" content="width=device-width, initial-scale=1.0">
+</head>
 <script src="../dist/iife/spine-webgl.js"></script>
 <script src="../dist/iife/spine-webgl.js"></script>
 <style>
 <style>
 	html,
 	html,

+ 5 - 0
spine-ts/spine-webgl/example/index.html

@@ -1,4 +1,9 @@
+<!DOCTYPE html>
 <html>
 <html>
+<head>
+	<meta charset="UTF-8">
+	<meta name="viewport" content="width=device-width, initial-scale=1.0">
+</head>
 <script src="../dist/iife/spine-webgl.js"></script>
 <script src="../dist/iife/spine-webgl.js"></script>
 <script src="https://code.jquery.com/jquery-3.1.0.min.js"></script>
 <script src="https://code.jquery.com/jquery-3.1.0.min.js"></script>
 <style>
 <style>

+ 5 - 0
spine-ts/spine-webgl/example/mix-and-match.html

@@ -1,4 +1,9 @@
+<!DOCTYPE html>
 <html>
 <html>
+<head>
+	<meta charset="UTF-8">
+	<meta name="viewport" content="width=device-width, initial-scale=1.0">
+</head>
 <script src="../dist/iife/spine-webgl.js"></script>
 <script src="../dist/iife/spine-webgl.js"></script>
 <style>
 <style>
 	html,
 	html,

+ 5 - 0
spine-ts/spine-webgl/example/physics.html

@@ -1,4 +1,9 @@
+<!DOCTYPE html>
 <html>
 <html>
+<head>
+	<meta charset="UTF-8">
+	<meta name="viewport" content="width=device-width, initial-scale=1.0">
+</head>
 <script src="../dist/iife/spine-webgl.js"></script>
 <script src="../dist/iife/spine-webgl.js"></script>
 <style>
 <style>
 	* {
 	* {

+ 10 - 2
spine-ts/spine-webgl/example/physics2.html

@@ -1,4 +1,9 @@
+<!DOCTYPE html>
 <html>
 <html>
+<head>
+	<meta charset="UTF-8">
+	<meta name="viewport" content="width=device-width, initial-scale=1.0">
+</head>
 <script src="../dist/iife/spine-webgl.js"></script>
 <script src="../dist/iife/spine-webgl.js"></script>
 <style>
 <style>
 	* {
 	* {
@@ -8,13 +13,14 @@
 </style>
 </style>
 
 
 <body>
 <body>
-	<span style="position: fixed; z-index: 10; top: 0; left: 0; color: white; padding: 1em;">Click and drag anywhere</span>
-	<canvas id="canvas" style="position: absolute; width: 100%; height: 100%;"></canvas>
+	<span id="label" style="position: fixed; z-index: 10; top: 0; left: 0; color: white; padding: 1em;"></span>
+	<canvas id="canvas" style="position: absolute; width: 100%; height: 100vh;"></canvas>
 	<script>
 	<script>
 		class App {
 		class App {
 			constructor() {
 			constructor() {
 				this.skeleton = null;
 				this.skeleton = null;
 				this.animationState = null;
 				this.animationState = null;
+				this.label = document.body.querySelector("#label");
 			}
 			}
 
 
 			loadAssets(canvas) {
 			loadAssets(canvas) {
@@ -92,6 +98,8 @@
 				// Let the skeleton update the transforms of its bones and apply physics
 				// Let the skeleton update the transforms of its bones and apply physics
 				this.skeleton.update(delta);
 				this.skeleton.update(delta);
 				this.skeleton.updateWorldTransform(spine.Physics.update);
 				this.skeleton.updateWorldTransform(spine.Physics.update);
+
+				this.label.innerText = "Click and drag anywhere (" + canvas.time.framesPerSecond.toFixed(2) + " fps)";
 			}
 			}
 
 
 			render(canvas) {
 			render(canvas) {