frigame3 0.0.0-stage → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/LICENSE +373 -0
  3. package/README.md +80 -2
  4. package/biome.json +93 -0
  5. package/demo/package-lock.json +515 -0
  6. package/demo/package.json +19 -0
  7. package/demo/snake/index.html +16 -0
  8. package/demo/snake/index.ts +110 -0
  9. package/demo/tetris/index.html +16 -0
  10. package/demo/tetris/index.ts +536 -0
  11. package/demo/tsconfig.json +53 -0
  12. package/frigame.css +12 -0
  13. package/package.json +50 -4
  14. package/src/Animation.ts +266 -0
  15. package/src/BaseSprite.ts +682 -0
  16. package/src/Gradient.ts +120 -0
  17. package/src/Playground.ts +247 -0
  18. package/src/Rect.ts +237 -0
  19. package/src/Rectangle.ts +108 -0
  20. package/src/Renderer.ts +28 -0
  21. package/src/ResourceManager.ts +145 -0
  22. package/src/Sprite.ts +484 -0
  23. package/src/SpriteGroup.ts +258 -0
  24. package/src/canvasRenderer/renderGroup.ts +194 -0
  25. package/src/canvasRenderer/renderPlayground.ts +103 -0
  26. package/src/canvasRenderer/renderRectangle.ts +421 -0
  27. package/src/canvasRenderer/renderSprite.ts +148 -0
  28. package/src/canvasRenderer.ts +38 -0
  29. package/src/dummyRenderer.ts +62 -0
  30. package/src/plugins/GamepadTracker.ts +97 -0
  31. package/src/plugins/Tilemap.ts +123 -0
  32. package/src/plugins/Vec2.ts +420 -0
  33. package/src/plugins/fx/Shaker.ts +293 -0
  34. package/src/plugins/fx/Tweener.ts +252 -0
  35. package/src/plugins/fx/easing.ts +276 -0
  36. package/src/plugins/isometric/ISOMixin.ts +444 -0
  37. package/src/plugins/isometric/ISORectangle.ts +183 -0
  38. package/src/plugins/isometric/ISOSprite.ts +228 -0
  39. package/src/plugins/isometric/ISOSpriteGroup.ts +155 -0
  40. package/src/plugins/isometric/ISOTilemap.ts +122 -0
  41. package/src/plugins/isometric/utils.ts +19 -0
  42. package/src/plugins/keyTracker.ts +31 -0
  43. package/src/plugins/mixer.ts +523 -0
  44. package/src/plugins/sorted/SortedAnimation.ts +53 -0
  45. package/src/plugins/sorted/SortedGroup.ts +94 -0
  46. package/src/plugins/sorted/SortedMixin.ts +203 -0
  47. package/src/plugins/sorted/SortedRectangle.ts +35 -0
  48. package/src/plugins/sorted/SortedSprite.ts +56 -0
  49. package/src/utils.ts +53 -0
  50. package/test/animation/index.html +20 -0
  51. package/test/animation/index.ts +253 -0
  52. package/test/animation/mh.png +0 -0
  53. package/test/animation/moh.png +0 -0
  54. package/test/animation/mov.png +0 -0
  55. package/test/animation/mv.png +0 -0
  56. package/test/animation/rebound.png +0 -0
  57. package/test/animation/reboundm.png +0 -0
  58. package/test/animation/sh.png +0 -0
  59. package/test/animation/soh.png +0 -0
  60. package/test/animation/sov.png +0 -0
  61. package/test/animation/sv.png +0 -0
  62. package/test/isometric1/beach.png +0 -0
  63. package/test/isometric1/foglie.png +0 -0
  64. package/test/isometric1/grass.png +0 -0
  65. package/test/isometric1/index.html +17 -0
  66. package/test/isometric1/index.ts +68 -0
  67. package/test/isometric1/tronco.png +0 -0
  68. package/test/isometric1/untitled.tmx +25 -0
  69. package/test/isometric1/water.png +0 -0
  70. package/test/isometric2/banner.png +0 -0
  71. package/test/isometric2/books.png +0 -0
  72. package/test/isometric2/candlestick.png +0 -0
  73. package/test/isometric2/ice.png +0 -0
  74. package/test/isometric2/index.html +16 -0
  75. package/test/isometric2/index.ts +129 -0
  76. package/test/isometric2/knight_se.png +0 -0
  77. package/test/isometric2/tile.png +0 -0
  78. package/test/isometric2/untitled.tmx +36 -0
  79. package/test/isometric2/wall.png +0 -0
  80. package/test/layers/boy.png +0 -0
  81. package/test/layers/catgirl.png +0 -0
  82. package/test/layers/fri1.svg +8 -0
  83. package/test/layers/grassblock.png +0 -0
  84. package/test/layers/horngirl.png +0 -0
  85. package/test/layers/index.html +17 -0
  86. package/test/layers/index.ts +191 -0
  87. package/test/layers/pinkgirl.png +0 -0
  88. package/test/layers/render_ruler.py +57 -0
  89. package/test/layers/ruler.png +0 -0
  90. package/test/layers/sh.png +0 -0
  91. package/test/mixer/dieci.opus +0 -0
  92. package/test/mixer/dieci.wav +0 -0
  93. package/test/mixer/index.html +33 -0
  94. package/test/mixer/index.ts +206 -0
  95. package/test/mixer/news_intro.mp3 +0 -0
  96. package/test/mixer/news_intro.ogg +0 -0
  97. package/test/mixer/prova.mp3 +0 -0
  98. package/test/mixer/prova.ogg +0 -0
  99. package/test/package-lock.json +515 -0
  100. package/test/package.json +19 -0
  101. package/test/sorted/Brown Block.png +0 -0
  102. package/test/sorted/index.html +16 -0
  103. package/test/sorted/index.ts +38 -0
  104. package/test/transformation1/index.html +17 -0
  105. package/test/transformation1/index.ts +51 -0
  106. package/test/transformation1/sh.png +0 -0
  107. package/test/transformation2/index.html +20 -0
  108. package/test/transformation2/index.ts +71 -0
  109. package/test/transformation2/sh.png +0 -0
  110. package/test/tsconfig.json +53 -0
  111. package/tsconfig.json +51 -0
@@ -0,0 +1,68 @@
1
+ import { canvasRenderer } from "frigame3/dist/canvasRenderer.js";
2
+ import { Playground } from "frigame3/dist/Playground.js";
3
+ import { ISOSpriteGroup } from "frigame3/dist/plugins/isometric/ISOSpriteGroup.js";
4
+ import { ISOTilemap } from "frigame3/dist/plugins/isometric/ISOTilemap.js";
5
+ import { SortedAnimation } from "frigame3/dist/plugins/sorted/SortedAnimation.js";
6
+ import { ResourceManager } from "frigame3/dist/ResourceManager.js";
7
+ import { SpriteGroup } from "frigame3/dist/SpriteGroup.js";
8
+
9
+ void (async (): Promise<void> => {
10
+ const rm = new ResourceManager();
11
+
12
+ const beach = rm.addResource(
13
+ new SortedAnimation({
14
+ imageURL: "beach.png",
15
+ originx: 50,
16
+ originy: 25,
17
+ }),
18
+ );
19
+ const grass = rm.addResource(new SortedAnimation("grass.png"));
20
+ const water = rm.addResource(
21
+ new SortedAnimation({
22
+ imageURL: "water.png",
23
+ originx: 50,
24
+ originy: 25,
25
+ }),
26
+ );
27
+
28
+ const tileDescription = {
29
+ sizex: 8,
30
+ sizey: 8,
31
+ tileSize: 50,
32
+ // biome-ignore format: reason
33
+ data: [
34
+ 3,1,1,1,1,1,1,2,
35
+ 1,1,1,1,1,1,1,1,
36
+ 1,1,1,1,1,1,1,1,
37
+ 1,1,1,1,1,1,1,1,
38
+ 1,1,1,1,1,1,1,1,
39
+ 1,1,1,1,1,1,1,1,
40
+ 1,1,1,1,1,1,1,1,
41
+ 2,1,1,1,1,1,1,3,
42
+ ],
43
+ animationList: {
44
+ 1: { animation: beach },
45
+ 2: { animation: grass, originx: 50, originy: 25 },
46
+ 3: { animation: water },
47
+ },
48
+ };
49
+
50
+ await rm.preload();
51
+
52
+ const playground = new Playground(canvasRenderer);
53
+ const sg = playground.scenegraph;
54
+
55
+ const my_group = sg.addChild(new SpriteGroup({ left: 400 }));
56
+ const iso_group = my_group.addChild(
57
+ new ISOSpriteGroup({
58
+ referencex: 0,
59
+ referencey: 0,
60
+ originx: 0,
61
+ originy: 0,
62
+ }),
63
+ );
64
+ const tilemap = iso_group.addChild(new ISOTilemap(tileDescription));
65
+
66
+ // biome-ignore lint/suspicious/noExplicitAny: reason
67
+ (window as any).tilemap = tilemap;
68
+ })();
Binary file
@@ -0,0 +1,25 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <map version="1.0" orientation="isometric" width="8" height="8" tilewidth="100" tileheight="50">
3
+ <tileset firstgid="1" name="beach" tilewidth="100" tileheight="50">
4
+ <image source="beach.png" width="100" height="65"/>
5
+ </tileset>
6
+ <tileset firstgid="2" name="grass" tilewidth="100" tileheight="50">
7
+ <image source="grass.png" width="100" height="65"/>
8
+ </tileset>
9
+ <tileset firstgid="3" name="water" tilewidth="100" tileheight="50">
10
+ <image source="water.png" width="100" height="58"/>
11
+ </tileset>
12
+ <layer name="Tile Layer 1" width="8" height="8">
13
+ <data encoding="csv">
14
+ 1,0,0,0,0,0,0,3,
15
+ 0,0,0,0,0,0,0,0,
16
+ 0,0,0,0,0,0,0,0,
17
+ 0,0,0,0,0,0,0,0,
18
+ 0,0,0,0,0,0,0,0,
19
+ 0,0,0,0,0,0,0,0,
20
+ 0,0,0,0,0,0,0,0,
21
+ 2,0,0,0,0,0,0,3
22
+ </data>
23
+ </layer>
24
+ <objectgroup name="Livello di Oggetti 1" width="8" height="8"/>
25
+ </map>
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,16 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+
6
+ <link rel="stylesheet" type="text/css" href="../../frigame.css">
7
+ </head>
8
+ <body style="position: relative;">
9
+ <div
10
+ id="playground"
11
+ style="position: relative; width: 1024px; height: 640px; background: #ff00ff;"
12
+ ></div>
13
+
14
+ <script src="bundle.js"></script>
15
+ </body>
16
+ </html>
@@ -0,0 +1,129 @@
1
+ import { canvasRenderer } from "frigame3/dist/canvasRenderer.js";
2
+ import { Playground } from "frigame3/dist/Playground.js";
3
+ import { ISOSprite } from "frigame3/dist/plugins/isometric/ISOSprite.js";
4
+ import { ISOTilemap } from "frigame3/dist/plugins/isometric/ISOTilemap.js";
5
+ import { gridFromScreen } from "frigame3/dist/plugins/isometric/utils.js";
6
+ import { SortedAnimation } from "frigame3/dist/plugins/sorted/SortedAnimation.js";
7
+ import { ResourceManager } from "frigame3/dist/ResourceManager.js";
8
+ import { SpriteGroup } from "frigame3/dist/SpriteGroup.js";
9
+
10
+ void (async (): Promise<void> => {
11
+ const rm = new ResourceManager();
12
+
13
+ const floor = rm.addResource(
14
+ new SortedAnimation({
15
+ imageURL: "tile.png",
16
+ originx: 64,
17
+ originy: 32,
18
+ }),
19
+ );
20
+ const ice_floor = rm.addResource(
21
+ new SortedAnimation({
22
+ imageURL: "ice.png",
23
+ originx: 64,
24
+ originy: 54,
25
+ }),
26
+ );
27
+ const block = rm.addResource(
28
+ new SortedAnimation({
29
+ imageURL: "tile.png",
30
+ originx: 64,
31
+ originy: 96,
32
+ }),
33
+ );
34
+ const ice = rm.addResource(
35
+ new SortedAnimation({
36
+ imageURL: "ice.png",
37
+ originx: 64,
38
+ originy: 118,
39
+ }),
40
+ );
41
+ const knight = rm.addResource(
42
+ new SortedAnimation({
43
+ imageURL: "knight_se.png",
44
+ numberOfFrame: 8,
45
+ }),
46
+ );
47
+
48
+ const animationList = {
49
+ 1: { animation: floor },
50
+ 2: { animation: ice_floor },
51
+ 3: { animation: block },
52
+ 4: { animation: ice, opacity: 0.8 },
53
+ };
54
+
55
+ const floorTiles = {
56
+ sizex: 8,
57
+ sizey: 8,
58
+ tileSize: 64,
59
+ // biome-ignore format: reason
60
+ data: [
61
+ 1,1,1,1,1,1,1,1,
62
+ 1,1,1,1,2,2,2,1,
63
+ 1,1,1,1,2,1,2,1,
64
+ 1,1,1,1,1,1,2,1,
65
+ 1,1,1,1,1,1,1,1,
66
+ 1,1,1,1,1,1,1,1,
67
+ 1,1,1,1,1,1,1,1,
68
+ 1,1,1,1,1,1,1,1,
69
+ ],
70
+ animationList,
71
+ };
72
+
73
+ const objectTiles = {
74
+ sizex: 8,
75
+ sizey: 8,
76
+ tileSize: 64,
77
+ // biome-ignore format: reason
78
+ data: [
79
+ 4,0,0,0,0,0,0,0,
80
+ 0,0,0,0,0,0,0,0,
81
+ 0,0,0,0,0,3,0,0,
82
+ 0,0,0,0,0,3,0,0,
83
+ 0,0,0,0,0,0,0,0,
84
+ 0,0,0,0,0,4,0,0,
85
+ 0,0,0,0,0,0,0,0,
86
+ 0,0,0,0,0,0,0,0,
87
+ ],
88
+ animationList,
89
+ };
90
+
91
+ await rm.preload();
92
+
93
+ const playground = new Playground(canvasRenderer);
94
+ const sg = playground.scenegraph;
95
+
96
+ const my_group = sg.addChild(new SpriteGroup({ left: 512, top: 64 }));
97
+
98
+ // floor_tilemap
99
+ my_group.addChild(new ISOTilemap(floorTiles));
100
+
101
+ const object_tilemap = my_group.addChild(new ISOTilemap(objectTiles));
102
+ const iso_knight = object_tilemap.addChild(
103
+ new ISOSprite({
104
+ centerx: 256,
105
+ centery: 256,
106
+ radius: 32,
107
+ animation: knight,
108
+ rate: 100,
109
+ }),
110
+ );
111
+
112
+ document.getElementById("playground")!.addEventListener("mousedown", (e) => {
113
+ const box = document.getElementById("playground")!.getBoundingClientRect();
114
+
115
+ const clicked_x = e.pageX - box.left;
116
+ const clicked_y = e.pageY - box.top;
117
+
118
+ const [iso_x, iso_y] = gridFromScreen(
119
+ clicked_x - my_group.left,
120
+ clicked_y - my_group.top,
121
+ );
122
+
123
+ iso_knight.centerx = iso_x;
124
+ iso_knight.centery = iso_y;
125
+ });
126
+
127
+ // biome-ignore lint/suspicious/noExplicitAny: reason
128
+ (window as any).object_tilemap = object_tilemap;
129
+ })();
Binary file
Binary file
@@ -0,0 +1,36 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <map version="1.0" orientation="isometric" width="8" height="8" tilewidth="128" tileheight="64">
3
+ <tileset firstgid="1" name="tile" tilewidth="128" tileheight="64">
4
+ <image source="../Work/GitHub/frigame_isometric/tests/layers/tile.png" width="128" height="128"/>
5
+ </tileset>
6
+ <tileset firstgid="3" name="block" tilewidth="128" tileheight="128">
7
+ <image source="../Work/GitHub/frigame_isometric/tests/layers/tile.png" width="128" height="128"/>
8
+ </tileset>
9
+ <tileset firstgid="4" name="ice_block" tilewidth="128" tileheight="128">
10
+ <image source="../Work/GitHub/frigame_isometric/tests/layers/ice.png" width="128" height="150"/>
11
+ </tileset>
12
+ <layer name="Tile Layer 1" width="8" height="8">
13
+ <data encoding="csv">
14
+ 1,1,1,1,1,1,1,1,
15
+ 1,1,1,1,1,1,1,1,
16
+ 1,1,1,1,1,1,1,1,
17
+ 1,1,1,1,1,1,1,1,
18
+ 1,1,1,1,1,1,1,1,
19
+ 1,1,1,1,1,1,1,1,
20
+ 1,1,1,1,1,1,1,1,
21
+ 1,1,1,1,1,1,1,1
22
+ </data>
23
+ </layer>
24
+ <layer name="Livello di Celle 2" width="8" height="8">
25
+ <data encoding="csv">
26
+ 4,0,0,0,0,0,0,0,
27
+ 0,0,0,0,0,0,0,0,
28
+ 0,0,0,0,0,0,0,0,
29
+ 0,0,0,0,0,0,0,0,
30
+ 0,0,0,0,0,0,0,0,
31
+ 0,0,0,0,0,4,0,0,
32
+ 0,0,0,0,0,0,0,0,
33
+ 0,0,0,0,0,0,0,0
34
+ </data>
35
+ </layer>
36
+ </map>
Binary file
Binary file
Binary file
@@ -0,0 +1,8 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 1 1" preserveAspectRatio="none">
2
+ <defs>
3
+ <clipPath id="myClip">
4
+ <path d="M 0 0 L 100 0 L 100 100 L 0 0" />
5
+ </clipPath>
6
+ </defs>
7
+ </svg>
8
+
Binary file
Binary file
@@ -0,0 +1,17 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+
6
+ <link rel="stylesheet" type="text/css" href="../../frigame.css">
7
+ </head>
8
+ <body style="position: relative;">
9
+ <h2>Movable layers:</h2>
10
+ <div
11
+ id="playground"
12
+ style="position: relative; width: 512px; height: 512px; background: white;"
13
+ ></div>
14
+
15
+ <script src="bundle.js"></script>
16
+ </body>
17
+ </html>
@@ -0,0 +1,191 @@
1
+ import { Animation } from "frigame3/dist/Animation.js";
2
+ import { canvasRenderer } from "frigame3/dist/canvasRenderer.js";
3
+ import { Gradient } from "frigame3/dist/Gradient.js";
4
+ import { Playground } from "frigame3/dist/Playground.js";
5
+ import { startKeyTracker } from "frigame3/dist/plugins/keyTracker.js";
6
+ import { Rectangle } from "frigame3/dist/Rectangle.js";
7
+ import { ResourceManager } from "frigame3/dist/ResourceManager.js";
8
+ import { Sprite } from "frigame3/dist/Sprite.js";
9
+ import { SpriteGroup } from "frigame3/dist/SpriteGroup.js";
10
+ import { spriteRef } from "frigame3/dist/utils.js";
11
+
12
+ void (async (): Promise<void> => {
13
+ const rm = new ResourceManager();
14
+
15
+ const ruler = rm.addResource(new Animation("ruler.png"));
16
+ const animation = rm.addResource(
17
+ new Animation({
18
+ imageURL: "sh.png",
19
+ type: "horizontal",
20
+ numberOfFrame: 4,
21
+ rate: 300,
22
+ }),
23
+ );
24
+ const gradient = new Gradient({ r: 128 }, { b: 255, a: 0.3 }, "horizontal");
25
+ const red = new Gradient({ r: 128 });
26
+ const blue = new Gradient({ b: 255, a: 0.6 });
27
+
28
+ // grassblock
29
+ rm.addResource(new Animation("grassblock.png"));
30
+
31
+ const boy = rm.addResource(new Animation("boy.png"));
32
+ const catgirl = rm.addResource(new Animation("catgirl.png"));
33
+ const horngirl = rm.addResource(new Animation("horngirl.png"));
34
+ const pinkgirl = rm.addResource(new Animation("pinkgirl.png"));
35
+
36
+ await rm.preload();
37
+
38
+ const playground = new Playground(canvasRenderer);
39
+ const sg = playground.scenegraph;
40
+
41
+ const rectangle1 = spriteRef<Rectangle>();
42
+ const sprite1 = spriteRef<Sprite>();
43
+ const sprite2 = spriteRef<Sprite>();
44
+ const group1 = spriteRef<SpriteGroup>();
45
+ sg.addChild(
46
+ new SpriteGroup({
47
+ width: sg.width,
48
+ height: sg.height,
49
+ ref: group1,
50
+ children: [
51
+ new Rectangle({
52
+ width: sg.width,
53
+ height: sg.height,
54
+ background: gradient,
55
+ ref: rectangle1,
56
+ }),
57
+ new Sprite({
58
+ animation: animation,
59
+ left: 16,
60
+ top: 32,
61
+ ref: sprite1,
62
+ }),
63
+ new Sprite({
64
+ animation: animation,
65
+ centerx: 0,
66
+ top: 192,
67
+ ref: sprite2,
68
+ }),
69
+ ],
70
+ }),
71
+ );
72
+
73
+ const group2 = sg.addChild(
74
+ new SpriteGroup({
75
+ left: 100,
76
+ top: 150,
77
+ width: 300,
78
+ height: 200,
79
+ children: [
80
+ new Rectangle({ width: 300, height: 200 }),
81
+ new Sprite({
82
+ animation: catgirl,
83
+ left: 32,
84
+ top: 32,
85
+ }),
86
+ new Sprite({
87
+ animation: horngirl,
88
+ left: 48,
89
+ top: 32,
90
+ }),
91
+ new Sprite({
92
+ animation: pinkgirl,
93
+ left: 64,
94
+ top: 32,
95
+ }),
96
+ ],
97
+ }),
98
+ );
99
+ group2.insertChild(new Sprite({ animation: boy, left: 16, top: 32 }));
100
+
101
+ sg.insertChild(
102
+ new SpriteGroup({
103
+ width: 1,
104
+ height: 1,
105
+ children: [new Sprite({ animation: ruler })],
106
+ }),
107
+ );
108
+
109
+ const rect1 = spriteRef<SpriteGroup>();
110
+ sg.addChild(
111
+ new SpriteGroup({
112
+ left: 48,
113
+ top: 48,
114
+ width: 64,
115
+ height: 64,
116
+ children: [
117
+ new Rectangle({
118
+ width: 64,
119
+ height: 64,
120
+ background: red,
121
+ borderColor: blue,
122
+ borderRadius: 14,
123
+ borderWidth: 12,
124
+ }),
125
+ new SpriteGroup({
126
+ width: 64,
127
+ height: 64,
128
+ borderRadius: 14,
129
+ ref: rect1,
130
+ children: [
131
+ new Sprite({
132
+ animation: catgirl,
133
+ left: 32,
134
+ top: 32,
135
+ }),
136
+ ],
137
+ }),
138
+ ],
139
+ }),
140
+ );
141
+
142
+ sg.addChild(
143
+ new SpriteGroup({
144
+ width: sg.width,
145
+ height: sg.height,
146
+ left: 100,
147
+ top: 370,
148
+ children: [
149
+ new Rectangle({
150
+ width: 300,
151
+ height: 100,
152
+ borderRadius: 20,
153
+ borderColor: blue,
154
+ borderWidth: 12,
155
+ }),
156
+ new Sprite({
157
+ animation: catgirl,
158
+ left: 32,
159
+ top: 32,
160
+ }),
161
+ ],
162
+ }),
163
+ );
164
+
165
+ sg.addChild(
166
+ new Sprite({
167
+ animation: animation,
168
+ centerx: 304,
169
+ centery: 48,
170
+ transformOriginx: 12,
171
+ transformOriginy: "height",
172
+ scalex: 3,
173
+ scaley: 2,
174
+ angle: (27 * Math.PI) / 180,
175
+ }),
176
+ );
177
+
178
+ group1.current!.left = 64;
179
+ group1.current!.top = 128;
180
+ group1.current!.width -= 64;
181
+ group1.current!.height -= 128;
182
+ rectangle1.current!.width -= 64;
183
+ rectangle1.current!.height -= 128;
184
+ sprite1.current!.angle = (45 * Math.PI) / 180;
185
+ sprite2.current!.scale = 2;
186
+ rect1.current!.crop = true;
187
+
188
+ console.log(group1);
189
+ console.log(rectangle1);
190
+ startKeyTracker();
191
+ })();
Binary file
@@ -0,0 +1,57 @@
1
+ #! /usr/bin/env python
2
+ # -*- coding: ascii -*-
3
+
4
+ from __future__ import division
5
+
6
+ import cairo
7
+
8
+ DIM_RULER = 512
9
+
10
+ STEP = 64
11
+
12
+ def main():
13
+ surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, DIM_RULER, DIM_RULER)
14
+ ctx = cairo.Context(surface)
15
+ ctx.set_antialias(cairo.ANTIALIAS_NONE)
16
+
17
+ ctx.set_source_rgb(1, 1, 0.85)
18
+ ctx.rectangle(0, 0, DIM_RULER, DIM_RULER)
19
+ ctx.fill()
20
+
21
+ ctx.set_line_width(1)
22
+
23
+ ctx.set_source_rgb(0.33, 0.33, 0.33)
24
+ for i in range(0, DIM_RULER, STEP):
25
+ ctx.move_to(i, 0)
26
+ ctx.line_to(i, DIM_RULER)
27
+ ctx.stroke()
28
+ ctx.move_to(0, i)
29
+ ctx.line_to(DIM_RULER, i)
30
+ ctx.stroke()
31
+
32
+ ctx.set_source_rgb(0.5, 0.5, 0.5)
33
+ for i in range(int(STEP // 2), DIM_RULER, STEP):
34
+ ctx.move_to(i, 0)
35
+ ctx.line_to(i, DIM_RULER)
36
+ ctx.stroke()
37
+ ctx.move_to(0, i)
38
+ ctx.line_to(DIM_RULER, i)
39
+ ctx.stroke()
40
+
41
+ ctx.set_source_rgb(0.66, 0.66, 0.66)
42
+ ctx.set_dash([2, 2])
43
+ for start in (int(STEP // 4), int((STEP * 3) // 4)):
44
+ for i in range(start, DIM_RULER, STEP):
45
+ ctx.move_to(i, 0)
46
+ ctx.line_to(i, DIM_RULER)
47
+ ctx.stroke()
48
+ ctx.move_to(0, i)
49
+ ctx.line_to(DIM_RULER, i)
50
+ ctx.stroke()
51
+
52
+ surface.write_to_png('ruler.png')
53
+
54
+
55
+ if __name__ == '__main__':
56
+ main()
57
+
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,33 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+
6
+ <link rel="stylesheet" type="text/css" href="../../frigame.css">
7
+ </head>
8
+ <body style="position: relative;">
9
+ <input type="button" id="start" value="Start Loading">
10
+ <input type="button" id="loadmono" value="Load Mono HTML5">
11
+ <input type="button" id="loadstereo" value="Load Stereo HTML5">
12
+ <input type="button" id="monomp3" value="Mono (mp3)">
13
+ <input type="button" id="stereomp3" value="Stereo (mp3)">
14
+ <input type="button" id="monosfx" value="Mono (sfx)">
15
+ <input type="button" id="stereosfx" value="Stereo (sfx)">
16
+ <input type="button" id="monowebaudio" value="Mono (webaudio)">
17
+ <input type="button" id="stereowebaudio" value="Stereo (webaudio)">
18
+ <input type="button" id="pause" value="Pause">
19
+ <input type="button" id="resume" value="Resume">
20
+ <input type="button" id="monohtml5" value="Mono (html5 audio)">
21
+ <input type="button" id="stereohtml5" value="Stereo (html5 audio)">
22
+ <input type="button" id="panleft" value="Pan left">
23
+ <input type="button" id="pancenter" value="Pan center">
24
+ <input type="button" id="panright" value="Pan right">
25
+ <input type="button" id="stop" value="Stop">
26
+ <input type="button" id="double" value="Double">
27
+ <input type="button" id="normal" value="Normal">
28
+ <input type="button" id="half" value="Half">
29
+ <input type="button" id="dieci" value="Dieci">
30
+
31
+ <script src="bundle.js"></script>
32
+ </body>
33
+ </html>