Browse Source

First commit for "Laureati Invaders", as downloaded from website

master
giomba 2 years ago
parent
commit
ee0797240f
  1. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Alloro-1.png
  2. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Alloro.png
  3. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Background1.jpeg
  4. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Base.png
  5. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Bestie.ogg
  6. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Bottone Play.png
  7. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Buco-nero-da-convertire-in-OOG.ogg
  8. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Carabinieri 1.2.png
  9. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Copertina0.jpg.png
  10. 57
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Extensions/DestroyOutsideBehavior/destroyoutsideruntimebehavior.js
  11. 343
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Extensions/PanelSpriteObject/panelspriteruntimeobject-pixi-renderer.js
  12. 222
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Extensions/PanelSpriteObject/panelspriteruntimeobject.js
  13. 39
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Extensions/SystemInfo/systeminfotools.js
  14. 166
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Extensions/TextObject/textruntimeobject-pixi-renderer.js
  15. 513
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Extensions/TextObject/textruntimeobject.js
  16. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Festa-di-Laurea-piena-da-convertire.ogg
  17. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Fire Empty.png
  18. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Fire.png
  19. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Fuoco 2.png
  20. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Fuoco 3.png
  21. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Fuoco 4.png
  22. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Fuoco.png
  23. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/GDevelop.png
  24. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Gioca ancora.png
  25. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Gioca.png
  26. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Kenney Future Narrow.ttf
  27. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Laureato 1.png
  28. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Laureato 2.png
  29. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Laureato 3.png
  30. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Laureato 6.png
  31. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Laureato 7.png
  32. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Laureato 9.png
  33. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Left.png
  34. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Left2.png
  35. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Lose-da-converitre-in-ogg.ogg
  36. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Sfondo.png
  37. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Vicienzo.png
  38. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Virus 2.png
  39. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Win-da-convertire-in-OGG.ogg
  40. 121
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/code0.js
  41. 1492
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/code1.js
  42. 111
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/code2.js
  43. 71
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/code3.js
  44. 54
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/code4.js
  45. 58
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/code5.js
  46. 1
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/data.js
  47. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/enemyBlack5.png
  48. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/enemyBlue1.png
  49. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/enemyGreen2.png
  50. 201
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/events-tools/cameratools.js
  51. 196
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/events-tools/commontools.js
  52. 284
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/events-tools/inputtools.js
  53. 127
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/events-tools/networktools.js
  54. 437
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/events-tools/objecttools.js
  55. 163
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/events-tools/runtimescenetools.js
  56. 163
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/events-tools/soundtools.js
  57. 254
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/events-tools/storagetools.js
  58. 120
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/events-tools/stringtools.js
  59. 80
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/events-tools/windowtools.js
  60. 128
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/fontfaceobserver-font-manager/fontfaceobserver-font-manager.js
  61. 16
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/fontfaceobserver-font-manager/fontfaceobserver.js
  62. 135
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/force.js
  63. 1
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/gd-splash-image.js
  64. 379
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/gd.js
  65. 419
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/howler-sound-manager/howler-sound-manager.js
  66. 4
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/howler-sound-manager/howler.min.js
  67. 114
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/index.html
  68. 317
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/inputmanager.js
  69. 158
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/jsonmanager.js
  70. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/laser1.ogg
  71. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/laser8.ogg
  72. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/laserGreen04.png
  73. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/laserRed06.png
  74. 391
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/layer.js
  75. 617
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/libs/hshg.js
  76. 134
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/libs/jshashtable.js
  77. 624
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/libs/rbush.js
  78. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/lose1.png
  79. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/lowRandom.ogg
  80. 52
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/oncetriggers.js
  81. 228
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/pixi-renderers/layer-pixi-renderer.js
  82. 83
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/pixi-renderers/loadingscreen-pixi-renderer.js
  83. 120
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/pixi-renderers/pixi-filters-tools.js
  84. 174
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/pixi-renderers/pixi-image-manager.js
  85. 22
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/pixi-renderers/pixi.js
  86. 496
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/pixi-renderers/runtimegame-pixi-renderer.js
  87. 87
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/pixi-renderers/runtimescene-pixi-renderer.js
  88. 137
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/pixi-renderers/spriteruntimeobject-pixi-renderer.js
  89. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/playerShip1_red.png
  90. 430
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/polygon.js
  91. 173
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/profiler.js
  92. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/right.png
  93. 149
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/runtimebehavior.js
  94. 528
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/runtimegame.js
  95. 1572
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/runtimeobject.js
  96. 822
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/runtimescene.js
  97. 144
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/scenestack.js
  98. BIN
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/spaceStation_028.png
  99. 1041
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/spriteruntimeobject.js
  100. 101
      games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/timemanager.js

BIN
games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Alloro-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 B

BIN
games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Alloro.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

BIN
games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Background1.jpeg

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

BIN
games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Base.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Bestie.ogg

Binary file not shown.

BIN
games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Bottone Play.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

BIN
games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Buco-nero-da-convertire-in-OOG.ogg

Binary file not shown.

BIN
games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Carabinieri 1.2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

BIN
games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Copertina0.jpg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

57
games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Extensions/DestroyOutsideBehavior/destroyoutsideruntimebehavior.js

@ -0,0 +1,57 @@
/**
GDevelop - DestroyOutside Behavior Extension
Copyright (c) 2013-2016 Florian Rival (Florian.Rival@gmail.com)
*/
/**
* The destroyOutsideRuntimeBehavior represents a behavior allowing objects to be
* moved using the mouse.
*
* @class DestroyOutsideRuntimeBehavior
* @constructor
*/
gdjs.DestroyOutsideRuntimeBehavior = function(runtimeScene, behaviorData, owner)
{
gdjs.RuntimeBehavior.call(this, runtimeScene, behaviorData, owner);
this._extraBorder = behaviorData.extraBorder || 0;
};
gdjs.DestroyOutsideRuntimeBehavior.prototype = Object.create( gdjs.RuntimeBehavior.prototype );
gdjs.registerBehavior("DestroyOutsideBehavior::DestroyOutside", gdjs.DestroyOutsideRuntimeBehavior);
gdjs.DestroyOutsideRuntimeBehavior.prototype.doStepPostEvents = function(runtimeScene) {
// TODO: This would better be done using the object AABB (getAABB), as (`getCenterX`;`getCenterY`) point
// is not necessarily in the middle of the object (for sprites for example).
var ow = this.owner.getWidth();
var oh = this.owner.getHeight();
var ocx = this.owner.getDrawableX()+this.owner.getCenterX();
var ocy = this.owner.getDrawableY()+this.owner.getCenterY();
var layer = runtimeScene.getLayer(this.owner.getLayer());
var boundingCircleRadius = Math.sqrt(ow*ow+oh*oh)/2.0;
if ( ocx+boundingCircleRadius+this._extraBorder < layer.getCameraX()-layer.getCameraWidth()/2
|| ocx-boundingCircleRadius-this._extraBorder > layer.getCameraX()+layer.getCameraWidth()/2
|| ocy+boundingCircleRadius+this._extraBorder < layer.getCameraY()-layer.getCameraHeight()/2
|| ocy-boundingCircleRadius-this._extraBorder > layer.getCameraY()+layer.getCameraHeight()/2 ) {
//We are outside the camera area.
this.owner.deleteFromScene(runtimeScene);
}
};
/**
* Set an additional border to the camera viewport as a buffer before the object gets destroyed.
* @param {number} val Border in pixels.
*/
gdjs.DestroyOutsideRuntimeBehavior.prototype.setExtraBorder = function(val) {
this._extraBorder = val;
};
/**
* Get the additional border of the camera viewport buffer which triggers the destruction of an object.
* @return {number} The additional border around the camera viewport in pixels
*/
gdjs.DestroyOutsideRuntimeBehavior.prototype.getExtraBorder = function() {
return this._extraBorder;
};

343
games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Extensions/PanelSpriteObject/panelspriteruntimeobject-pixi-renderer.js

@ -0,0 +1,343 @@
gdjs.PanelSpriteRuntimeObjectPixiRenderer = function(
runtimeObject,
runtimeScene,
textureName,
tiled
) {
this._object = runtimeObject;
if (this._spritesContainer === undefined) {
var texture = runtimeScene
.getGame()
.getImageManager()
.getPIXITexture(textureName);
var StretchedSprite = !tiled ? PIXI.Sprite : PIXI.extras.TilingSprite;
this._spritesContainer = new PIXI.Container();
this._centerSprite = new StretchedSprite(new PIXI.Texture(texture));
this._borderSprites = [
new StretchedSprite(new PIXI.Texture(texture)), //Right
new PIXI.Sprite(texture), //Top-Right
new StretchedSprite(new PIXI.Texture(texture)), //Top
new PIXI.Sprite(texture), //Top-Left
new StretchedSprite(new PIXI.Texture(texture)), //Left
new PIXI.Sprite(texture), //Bottom-Left
new StretchedSprite(new PIXI.Texture(texture)), //Bottom
new PIXI.Sprite(texture), //Bottom-Right
];
}
this.setTexture(textureName, runtimeScene);
this._spritesContainer.removeChildren();
this._spritesContainer.addChild(this._centerSprite);
for (var i = 0; i < this._borderSprites.length; ++i) {
this._spritesContainer.addChild(this._borderSprites[i]);
}
this._alpha = this._spritesContainer.alpha;
runtimeScene
.getLayer('')
.getRenderer()
.addRendererObject(this._spritesContainer, runtimeObject.getZOrder());
};
gdjs.PanelSpriteRuntimeObjectRenderer =
gdjs.PanelSpriteRuntimeObjectPixiRenderer; //Register the class to let the engine use it.
gdjs.PanelSpriteRuntimeObjectPixiRenderer.prototype.getRendererObject = function() {
return this._spritesContainer;
};
gdjs.PanelSpriteRuntimeObjectPixiRenderer.prototype.ensureUpToDate = function() {
if (this._spritesContainer.visible && this._wasRendered) {
// Update the alpha of the container to make sure that it's applied.
// If not done, the alpha will be back to full opaque when changing the color
// of the object.
this._spritesContainer.alpha = this._alpha;
this._spritesContainer.cacheAsBitmap = true;
}
this._wasRendered = true;
};
gdjs.PanelSpriteRuntimeObjectPixiRenderer.prototype.updateOpacity = function() {
//TODO: Workaround a not working property in PIXI.js:
this._spritesContainer.alpha = this._spritesContainer.visible
? this._object.opacity / 255
: 0;
this._alpha = this._spritesContainer.alpha;
};
gdjs.PanelSpriteRuntimeObjectPixiRenderer.prototype.updateAngle = function() {
this._spritesContainer.rotation = gdjs.toRad(this._object.angle);
};
gdjs.PanelSpriteRuntimeObjectPixiRenderer.prototype.updatePosition = function() {
this._spritesContainer.position.x = this._object.x + this._object._width / 2;
this._spritesContainer.position.y = this._object.y + this._object._height / 2;
};
gdjs.PanelSpriteRuntimeObjectPixiRenderer.prototype._updateLocalPositions = function() {
var obj = this._object;
this._centerSprite.position.x = obj._lBorder;
this._centerSprite.position.y = obj._tBorder;
//Right
this._borderSprites[0].position.x = obj._width - obj._rBorder;
this._borderSprites[0].position.y = obj._tBorder;
//Top-right
this._borderSprites[1].position.x = obj._width - this._borderSprites[1].width;
this._borderSprites[1].position.y = 0;
//Top
this._borderSprites[2].position.x = obj._lBorder;
this._borderSprites[2].position.y = 0;
//Top-Left
this._borderSprites[3].position.x = 0;
this._borderSprites[3].position.y = 0;
//Left
this._borderSprites[4].position.x = 0;
this._borderSprites[4].position.y = obj._tBorder;
//Bottom-Left
this._borderSprites[5].position.x = 0;
this._borderSprites[5].position.y =
obj._height - this._borderSprites[5].height;
//Bottom
this._borderSprites[6].position.x = obj._lBorder;
this._borderSprites[6].position.y = obj._height - obj._bBorder;
//Bottom-Right
this._borderSprites[7].position.x = obj._width - this._borderSprites[7].width;
this._borderSprites[7].position.y =
obj._height - this._borderSprites[7].height;
};
gdjs.PanelSpriteRuntimeObjectPixiRenderer.prototype._updateSpritesAndTexturesSize = function() {
var obj = this._object;
this._centerSprite.width = Math.max(
obj._width - obj._rBorder - obj._lBorder,
0
);
this._centerSprite.height = Math.max(
obj._height - obj._tBorder - obj._bBorder,
0
);
//Right
this._borderSprites[0].width = obj._rBorder;
this._borderSprites[0].height = Math.max(
obj._height - obj._tBorder - obj._bBorder,
0
);
//Top
this._borderSprites[2].height = obj._tBorder;
this._borderSprites[2].width = Math.max(
obj._width - obj._rBorder - obj._lBorder,
0
);
//Left
this._borderSprites[4].width = obj._lBorder;
this._borderSprites[4].height = Math.max(
obj._height - obj._tBorder - obj._bBorder,
0
);
//Bottom
this._borderSprites[6].height = obj._bBorder;
this._borderSprites[6].width = Math.max(
obj._width - obj._rBorder - obj._lBorder,
0
);
this._wasRendered = true;
this._spritesContainer.cacheAsBitmap = false;
};
gdjs.PanelSpriteRuntimeObjectPixiRenderer.prototype.setTexture = function(
textureName,
runtimeScene
) {
var obj = this._object;
var texture = runtimeScene
.getGame()
.getImageManager()
.getPIXITexture(textureName);
function makeInsideTexture(rect) {
//TODO
if (rect.width < 0) rect.width = 0;
if (rect.height < 0) rect.height = 0;
if (rect.x < 0) rect.x = 0;
if (rect.y < 0) rect.y = 0;
if (rect.x > texture.width) rect.x = texture.width;
if (rect.y > texture.height) rect.y = texture.height;
if (rect.x + rect.width > texture.width)
rect.width = texture.width - rect.x;
if (rect.y + rect.height > texture.height)
rect.height = texture.height - rect.y;
return rect;
}
this._centerSprite.texture = new PIXI.Texture(
texture,
makeInsideTexture(
new PIXI.Rectangle(
obj._lBorder,
obj._tBorder,
texture.width - obj._lBorder - obj._rBorder,
texture.height - obj._tBorder - obj._bBorder
)
)
);
//Top, Bottom, Right, Left borders:
this._borderSprites[0].texture = new PIXI.Texture(
texture,
makeInsideTexture(
new PIXI.Rectangle(
texture.width - obj._rBorder,
obj._tBorder,
obj._rBorder,
texture.height - obj._tBorder - obj._bBorder
)
)
);
this._borderSprites[2].texture = new PIXI.Texture(
texture,
makeInsideTexture(
new PIXI.Rectangle(
obj._lBorder,
0,
texture.width - obj._lBorder - obj._rBorder,
obj._tBorder
)
)
);
this._borderSprites[4].texture = new PIXI.Texture(
texture,
makeInsideTexture(
new PIXI.Rectangle(
0,
obj._tBorder,
obj._lBorder,
texture.height - obj._tBorder - obj._bBorder
)
)
);
this._borderSprites[6].texture = new PIXI.Texture(
texture,
makeInsideTexture(
new PIXI.Rectangle(
obj._lBorder,
texture.height - obj._bBorder,
texture.width - obj._lBorder - obj._rBorder,
obj._bBorder
)
)
);
this._borderSprites[1].texture = new PIXI.Texture(
texture,
makeInsideTexture(
new PIXI.Rectangle(
this._borderSprites[1].width - obj._rBorder,
0,
obj._rBorder,
obj._tBorder
)
)
);
this._borderSprites[3].texture = new PIXI.Texture(
texture,
makeInsideTexture(new PIXI.Rectangle(0, 0, obj._lBorder, obj._tBorder))
);
this._borderSprites[5].texture = new PIXI.Texture(
texture,
makeInsideTexture(
new PIXI.Rectangle(
0,
this._borderSprites[5].height - obj._bBorder,
obj._lBorder,
obj._bBorder
)
)
);
this._borderSprites[7].texture = new PIXI.Texture(
texture,
makeInsideTexture(
new PIXI.Rectangle(
this._borderSprites[7].width - obj._rBorder,
this._borderSprites[7].height - obj._bBorder,
obj._rBorder,
obj._bBorder
)
)
);
this._updateSpritesAndTexturesSize();
this._updateLocalPositions();
this.updatePosition();
this._spritesContainer.pivot.x = this._object._width / 2;
this._spritesContainer.pivot.y = this._object._height / 2;
};
gdjs.PanelSpriteRuntimeObjectPixiRenderer.prototype.updateWidth = function() {
this._spritesContainer.pivot.x = this._object._width / 2;
this._updateSpritesAndTexturesSize();
this._updateLocalPositions();
this.updatePosition();
};
gdjs.PanelSpriteRuntimeObjectPixiRenderer.prototype.updateHeight = function() {
this._spritesContainer.pivot.y = this._object._height / 2;
this._updateSpritesAndTexturesSize();
this._updateLocalPositions();
this.updatePosition();
};
gdjs.PanelSpriteRuntimeObjectPixiRenderer.prototype.setColor = function(
rgbColor
) {
var colors = rgbColor.split(';');
if (colors.length < 3) return;
this._centerSprite.tint =
'0x' +
gdjs.rgbToHex(
parseInt(colors[0], 10),
parseInt(colors[1], 10),
parseInt(colors[2], 10)
);
for (
var borderCounter = 0;
borderCounter < this._borderSprites.length;
borderCounter++
) {
this._borderSprites[borderCounter].tint =
'0x' +
gdjs.rgbToHex(
parseInt(colors[0], 10),
parseInt(colors[1], 10),
parseInt(colors[2], 10)
);
}
this._spritesContainer.cacheAsBitmap = false;
};
gdjs.PanelSpriteRuntimeObjectPixiRenderer.prototype.getColor = function() {
var rgb = PIXI.utils.hex2rgb(this._centerSprite.tint);
return (
Math.floor(rgb[0] * 255) +
';' +
Math.floor(rgb[1] * 255) +
';' +
Math.floor(rgb[2] * 255)
);
};

222
games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Extensions/PanelSpriteObject/panelspriteruntimeobject.js

@ -0,0 +1,222 @@
/*
* GDevelop JS Platform
* 2013 Florian Rival (Florian.Rival@gmail.com)
*/
/**
* @typedef {Object} PanelSpriteObjectDataType
* @property {number} rightMargin The right margin
* @property {number} leftMargin The left margin
* @property {number} topMargin The top margin
* @property {number} bottomMargin The bottom margin
* @property {boolean} [tiled] Are the central part and borders tiled?
* @property {number} width The object width
* @property {number} height The object height
* @property {string} texture The name of the resource containing the texture to use
*
* @typedef {ObjectData & PanelSpriteObjectDataType} PanelSpriteObjectData
*/
/**
* The PanelSpriteRuntimeObject displays a tiled texture.
*
* @class PanelSpriteRuntimeObject
* @extends RuntimeObject
* @memberof gdjs
* @param {gdjs.RuntimeScene} runtimeScene The {@link gdjs.RuntimeScene} the object belongs to
* @param {PanelSpriteObjectData} panelSpriteObjectData The initial properties of the object
*/
gdjs.PanelSpriteRuntimeObject = function(runtimeScene, panelSpriteObjectData) {
gdjs.RuntimeObject.call(this, runtimeScene, panelSpriteObjectData);
/** @type {number} */
this._rBorder = panelSpriteObjectData.rightMargin;
/** @type {number} */
this._lBorder = panelSpriteObjectData.leftMargin;
/** @type {number} */
this._tBorder = panelSpriteObjectData.topMargin;
/** @type {number} */
this._bBorder = panelSpriteObjectData.bottomMargin;
/** @type {boolean} */
this._tiled = panelSpriteObjectData.tiled;
/** @type {number} */
this._width = panelSpriteObjectData.width;
/** @type {number} */
this._height = panelSpriteObjectData.height;
/** @type {number} */
this.opacity = 255;
if (this._renderer) {
gdjs.PanelSpriteRuntimeObjectRenderer.call(
this._renderer,
this,
runtimeScene,
panelSpriteObjectData.texture,
panelSpriteObjectData.tiled
);
} else {
/** @type {gdjs.PanelSpriteRuntimeObjectRenderer} */
this._renderer = new gdjs.PanelSpriteRuntimeObjectRenderer(
this,
runtimeScene,
panelSpriteObjectData.texture,
panelSpriteObjectData.tiled
);
}
// *ALWAYS* call `this.onCreated()` at the very end of your object constructor.
this.onCreated();
};
gdjs.PanelSpriteRuntimeObject.prototype = Object.create(
gdjs.RuntimeObject.prototype
);
gdjs.registerObject("PanelSpriteObject::PanelSprite", gdjs.PanelSpriteRuntimeObject);
gdjs.PanelSpriteRuntimeObject.prototype.getRendererObject = function() {
return this._renderer.getRendererObject();
};
gdjs.PanelSpriteRuntimeObject.prototype.onDestroyFromScene = function(
runtimeScene
) {
gdjs.RuntimeObject.prototype.onDestroyFromScene.call(this, runtimeScene);
if (this._renderer.onDestroy) {
this._renderer.onDestroy();
}
};
gdjs.PanelSpriteRuntimeObject.prototype.update = function() {
this._renderer.ensureUpToDate();
};
/**
* Initialize the extra parameters that could be set for an instance.
*/
gdjs.PanelSpriteRuntimeObject.prototype.extraInitializationFromInitialInstance = function(
initialInstanceData
) {
if (initialInstanceData.customSize) {
this.setWidth(initialInstanceData.width);
this.setHeight(initialInstanceData.height);
}
};
/**
* Set the x position of the panel sprite.
* @param {number} x The new x position in pixels.
*/
gdjs.PanelSpriteRuntimeObject.prototype.setX = function(x) {
gdjs.RuntimeObject.prototype.setX.call(this, x);
this._renderer.updatePosition();
};
/**
* Set the y position of the panel sprite.
* @param {number} y The new y position in pixels.
*/
gdjs.PanelSpriteRuntimeObject.prototype.setY = function(y) {
gdjs.RuntimeObject.prototype.setY.call(this, y);
this._renderer.updatePosition();
};
/**
* Set the texture of the panel sprite.
* @param {string} textureName The name of the texture.
* @param {gdjs.RuntimeScene} runtimeScene The scene the object lives in.
*/
gdjs.PanelSpriteRuntimeObject.prototype.setTexture = function(
textureName,
runtimeScene
) {
this._renderer.setTexture(textureName, runtimeScene);
};
/**
* Set the angle of the panel sprite.
* @param {number} angle The new angle in degrees.
*/
gdjs.PanelSpriteRuntimeObject.prototype.setAngle = function(angle) {
gdjs.RuntimeObject.prototype.setAngle.call(this, angle);
this._renderer.updateAngle();
};
/**
* Get the width of the panel sprite in pixels
* @return {number} The width in pixels
*/
gdjs.PanelSpriteRuntimeObject.prototype.getWidth = function() {
return this._width;
};
/**
* Get the height of the panel sprite in pixels
* @return {number} The height in pixels
*/
gdjs.PanelSpriteRuntimeObject.prototype.getHeight = function() {
return this._height;
};
/**
* Set the width of the panel sprite.
* @param {number} width The new width in pixels.
*/
gdjs.PanelSpriteRuntimeObject.prototype.setWidth = function(width) {
this._width = width;
this._renderer.updateWidth();
};
/**
* Set the height of the panel sprite.
* @param {number} height The new height in pixels.
*/
gdjs.PanelSpriteRuntimeObject.prototype.setHeight = function(height) {
this._height = height;
this._renderer.updateHeight();
};
/**
* Change the transparency of the object.
* @param {number} opacity The new opacity, between 0 (transparent) and 255 (opaque).
*/
gdjs.PanelSpriteRuntimeObject.prototype.setOpacity = function(opacity) {
if (opacity < 0) opacity = 0;
if (opacity > 255) opacity = 255;
this.opacity = opacity;
this._renderer.updateOpacity();
};
/**
* Get the transparency of the object.
* @return {number} The opacity, between 0 (transparent) and 255 (opaque).
*/
gdjs.PanelSpriteRuntimeObject.prototype.getOpacity = function() {
return this.opacity;
};
/**
* Change the tint of the panel sprite object.
*
* @param {string} rgbColor The color, in RGB format ("128;200;255").
*/
gdjs.PanelSpriteRuntimeObject.prototype.setColor = function(rgbColor) {
this._renderer.setColor(rgbColor);
};
/**
* Get the tint of the panel sprite object.
*
* @returns {string} rgbColor The color, in RGB format ("128;200;255").
*/
gdjs.PanelSpriteRuntimeObject.prototype.getColor = function() {
return this._renderer.getColor();
};

39
games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Extensions/SystemInfo/systeminfotools.js

@ -0,0 +1,39 @@
/**
GDevelop - SystemInfo Extension
Copyright (c) 2016 Florian Rival (Florian.Rival@gmail.com)
*/
/**
* @memberof gdjs.evtTools
* @class linkedObjects
* @static
* @private
*/
gdjs.evtTools.systemInfo = {};
gdjs.evtTools.systemInfo.isMobile = function() {
if (typeof cc !== "undefined" && cc.sys) {
return cc.sys.isMobile;
} else if (typeof Cocoon !== "undefined" && Cocoon.App) {
return true;
} else if (typeof window !== "undefined" && window.cordova) {
return true;
} else if (typeof window !== "undefined") {
// Try to detect mobile device browsers.
if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)
|| /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4))) {
return true;
}
}
return false;
};
/**
* Check if the the device supports WebGL.
* @param {gdjs.RuntimeScene} runtimeScene
* @returns {boolean} true if WebGL is supported
*/
gdjs.evtTools.systemInfo.isWebGLSupported = function(runtimeScene) {
return runtimeScene.getGame().getRenderer().isWebGLSupported();
};

166
games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Extensions/TextObject/textruntimeobject-pixi-renderer.js

@ -0,0 +1,166 @@
gdjs.TextRuntimeObjectPixiRenderer = function(runtimeObject, runtimeScene)
{
this._object = runtimeObject;
this._fontManager = runtimeScene.getGame().getFontManager();
if ( this._text === undefined ) this._text = new PIXI.Text(" ", {align:"left"});
this._text.anchor.x = 0.5;
this._text.anchor.y = 0.5;
runtimeScene.getLayer("").getRenderer().addRendererObject(this._text, runtimeObject.getZOrder());
this._text.text = runtimeObject._str.length === 0 ? " " : runtimeObject._str;
this._justCreated = true; //Work around a PIXI.js bug. See updateTime method.
this.updateStyle();
this.updatePosition();
};
gdjs.TextRuntimeObjectRenderer = gdjs.TextRuntimeObjectPixiRenderer; //Register the class to let the engine use it.
gdjs.TextRuntimeObjectPixiRenderer.prototype.getRendererObject = function() {
return this._text;
};
gdjs.TextRuntimeObjectPixiRenderer.prototype.ensureUpToDate = function() {
if (this._justCreated) { //Work around a PIXI.js bug:
this._text.updateText();
this.updatePosition(); //Width seems not to be correct when text is not rendered yet.
this._justCreated = false;
}
};
gdjs.TextRuntimeObjectPixiRenderer.prototype.updateStyle = function() {
var fontName = "\"" + this._fontManager.getFontFamily(this._object._fontName) + "\"";
var style = this._text.style;
style.fontStyle = this._object._italic ? 'italic' : 'normal';
style.fontWeight = this._object._bold ? 'bold' : 'normal';
style.fontSize = this._object._characterSize;
style.fontFamily = fontName;
if (this._object._useGradient){
style.fill = this._getGradientHex();
} else {
style.fill = this._getColorHex();
}
if (this._object._gradientType === 'LINEAR_VERTICAL'){
style.fillGradientType = PIXI.TEXT_GRADIENT.LINEAR_VERTICAL;
} else {
style.fillGradientType = PIXI.TEXT_GRADIENT.LINEAR_HORIZONTAL;
}
style.align = this._object._textAlign;
style.wordWrap = this._object._wrapping;
style.wordWrapWidth = this._object._wrappingWidth;
style.breakWords = true;
style.stroke = gdjs.rgbToHexNumber(
this._object._outlineColor[0],
this._object._outlineColor[1],
this._object._outlineColor[2]
);
style.strokeThickness = this._object._outlineThickness;
style.dropShadow = this._object._shadow;
style.dropShadowColor = gdjs.rgbToHexNumber(
this._object._shadowColor[0],
this._object._shadowColor[1],
this._object._shadowColor[2]
);
style.dropShadowBlur = this._object._shadowBlur;
style.dropShadowAngle = this._object._shadowAngle;
style.dropShadowDistance = this._object._shadowDistance;
style.padding = this._object._padding;
// Prevent spikey outlines by adding a miter limit
style.miterLimit = 3;
this.updatePosition();
// Manually ask the PIXI object to re-render as we changed a style property
// see http://www.html5gamedevs.com/topic/16924-change-text-style-post-render/
this._text.dirty = true;
};
gdjs.TextRuntimeObjectPixiRenderer.prototype.updatePosition = function() {
this._text.position.x = this._object.x+this._text.width/2;
this._text.position.y = this._object.y+this._text.height/2;
};
gdjs.TextRuntimeObjectPixiRenderer.prototype.updateAngle = function() {
this._text.rotation = gdjs.toRad(this._object.angle);
};
gdjs.TextRuntimeObjectPixiRenderer.prototype.updateOpacity = function() {
this._text.alpha = this._object.opacity / 255;
};
gdjs.TextRuntimeObjectPixiRenderer.prototype.updateString = function() {
this._text.text = this._object._str.length === 0 ? " " : this._object._str;
this._text.updateText(); //Work around a PIXI.js bug.
};
gdjs.TextRuntimeObjectPixiRenderer.prototype.getWidth = function() {
return this._text.width;
};
gdjs.TextRuntimeObjectPixiRenderer.prototype.getHeight = function() {
return this._text.height;
};
gdjs.TextRuntimeObjectPixiRenderer.prototype._getColorHex = function() {
return gdjs.rgbToHexNumber(
this._object._color[0],
this._object._color[1],
this._object._color[2]
);
}
gdjs.TextRuntimeObjectPixiRenderer.prototype._getGradientHex = function() {
var gradient = [];
for (var colorIndex = 0; colorIndex < this._object._gradient.length; colorIndex++){
gradient.push(
'#' + gdjs.rgbToHex(
this._object._gradient[colorIndex][0],
this._object._gradient[colorIndex][1],
this._object._gradient[colorIndex][2]
)
);
}
return gradient;
}
/**
* Get y-scale of the text.
*/
gdjs.TextRuntimeObjectPixiRenderer.prototype.getScaleX = function() {
return this._text.scale.x;
};
/**
* Get x-scale of the text.
*/
gdjs.TextRuntimeObjectPixiRenderer.prototype.getScaleY = function() {
return this._text.scale.y;
};
/**
* Set the text object scale.
* @param {number} newScale The new scale for the text object.
*/
gdjs.TextRuntimeObjectPixiRenderer.prototype.setScale = function(newScale) {
this._text.scale.x = newScale;
this._text.scale.y = newScale;
};
/**
* Set the text object x-scale.
* @param {number} newScale The new x-scale for the text object.
*/
gdjs.TextRuntimeObjectPixiRenderer.prototype.setScaleX = function(newScale) {
this._text.scale.x = newScale;
};
/**
* Set the text object y-scale.
* @param {number} newScale The new y-scale for the text object.
*/
gdjs.TextRuntimeObjectPixiRenderer.prototype.setScaleY = function(newScale) {
this._text.scale.y = newScale;
};

513
games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Extensions/TextObject/textruntimeobject.js

@ -0,0 +1,513 @@
/*
* GDevelop JS Platform
* 2013-2016 Florian Rival (Florian.Rival@gmail.com)
*/
/**
* @typedef {Object} TextObjectDataType Base parameters for gdjs.TextRuntimeObject
* @property {number} characterSize The size of the characters
* @property {string} font The font name
* @property {boolean} bold Is Bold?
* @property {boolean} italic Is Italic?
* @property {boolean} underlined Is Underlined?
* @property {Object} color The text color in an RGB representation
* @property {number} color.r The Red level from 0 to 255
* @property {number} color.g The Green level from 0 to 255
* @property {number} color.b The Blue level from 0 to 255
* @property {string} string The text of the object
*
* @typedef {ObjectData & TextObjectDataType} TextObjectData
*/
/**
* Displays a text.
*
* @memberof gdjs
* @class TextRuntimeObject
* @extends RuntimeObject
* @param {gdjs.RuntimeScene} runtimeScene The {@link gdjs.RuntimeScene} the object belongs to
* @param {TextObjectData} textObjectData The initial properties of the object
*/
gdjs.TextRuntimeObject = function(runtimeScene, textObjectData)
{
gdjs.RuntimeObject.call(this, runtimeScene, textObjectData);
/** @type {number} */
this._characterSize = Math.max(1, textObjectData.characterSize);
/** @type {string} */
this._fontName = textObjectData.font;
/** @type {boolean} */
this._bold = textObjectData.bold;
/** @type {boolean} */
this._italic = textObjectData.italic;
/** @type {boolean} */
this._underlined = textObjectData.underlined;
/** @type {Array<number>} */
this._color = [textObjectData.color.r, textObjectData.color.g, textObjectData.color.b];
/** @type {boolean} */
this._useGradient = false;
/** @type {Array} */
this._gradient = [];
/** @type {string} */
this._gradientType = '';
/** @type {number} */
this.opacity = 255;
/** @type {string} */
this._textAlign = 'left';
/** @type {boolean} */
this._wrapping = false;
/** @type {number} */
this._wrappingWidth = 1;
/** @type {number} */
this._outlineThickness = 0;
/** @type {Array<number>} */
this._outlineColor = [255,255,255];
/** @type {boolean} */
this._shadow = false;
/** @type {Array<number>} */
this._shadowColor = [0,0,0];
/** @type {number} */
this._shadowDistance = 1;
/** @type {number} */
this._shadowBlur = 1;
/** @type {number} */
this._shadowAngle = 0;
/** @type {number} */
this._padding = 5;
/** @type {number} */
this._scaleX = 1;
/** @type {number} */
this._scaleY = 1;
/** @type {string} */
this._str = textObjectData.string;
if (this._renderer)
gdjs.TextRuntimeObjectRenderer.call(this._renderer, this, runtimeScene);
else
/** @type {gdjs.TextRuntimeObjectRenderer} */
this._renderer = new gdjs.TextRuntimeObjectRenderer(this, runtimeScene);
// *ALWAYS* call `this.onCreated()` at the very end of your object constructor.
this.onCreated();
};
gdjs.TextRuntimeObject.prototype = Object.create( gdjs.RuntimeObject.prototype );
gdjs.registerObject("TextObject::Text", gdjs.TextRuntimeObject);
gdjs.TextRuntimeObject.prototype.getRendererObject = function() {
return this._renderer.getRendererObject();
};
gdjs.TextRuntimeObject.prototype.update = function() {
this._renderer.ensureUpToDate();
};
/**
* Initialize the extra parameters that could be set for an instance.
* @private
*/
gdjs.TextRuntimeObject.prototype.extraInitializationFromInitialInstance = function(initialInstanceData) {
if ( initialInstanceData.customSize ) {
this.setWrapping(true);
this.setWrappingWidth(initialInstanceData.width);
}
};
/**
* Update the rendered object position.
* @private
*/
gdjs.TextRuntimeObject.prototype._updateTextPosition = function() {
this.hitBoxesDirty = true;
this._renderer.updatePosition();
};
/**
* Set object position on X axis.
*/
gdjs.TextRuntimeObject.prototype.setX = function(x) {
gdjs.RuntimeObject.prototype.setX.call(this, x);
this._updateTextPosition();
};
/**
* Set object position on Y axis.
*/
gdjs.TextRuntimeObject.prototype.setY = function(y) {
gdjs.RuntimeObject.prototype.setY.call(this, y);
this._updateTextPosition();
};
/**
* Set the angle of the object.
* @param {number} angle The new angle of the object
*/
gdjs.TextRuntimeObject.prototype.setAngle = function(angle) {
gdjs.RuntimeObject.prototype.setAngle.call(this, angle);
this._renderer.updateAngle();
};
/**
* Set object opacity.
*/
gdjs.TextRuntimeObject.prototype.setOpacity = function(opacity) {
if ( opacity < 0 ) opacity = 0;
if ( opacity > 255 ) opacity = 255;
this.opacity = opacity;
this._renderer.updateOpacity();
};
/**
* Get object opacity.
*/
gdjs.TextRuntimeObject.prototype.getOpacity = function() {
return this.opacity;
};
/**
* Get the string displayed by the object.
*/
gdjs.TextRuntimeObject.prototype.getString = function() {
return this._str;
};
/**
* Set the string displayed by the object.
* @param {string} str The new text
*/
gdjs.TextRuntimeObject.prototype.setString = function(str) {
if ( str === this._str ) return;
this._str = str;
this._renderer.updateString();
this._updateTextPosition();
};
/**
* Get the font size of the characters of the object.
*/
gdjs.TextRuntimeObject.prototype.getCharacterSize = function() {
return this._characterSize;
};
/**
* Set the font size for characters of the object.
* @param {number} newSize The new font size for the text.
*/
gdjs.TextRuntimeObject.prototype.setCharacterSize = function(newSize) {
if (newSize <= 1) newSize = 1;
this._characterSize = newSize;
this._renderer.updateStyle();
};
/**
* Return true if the text is bold.
*/
gdjs.TextRuntimeObject.prototype.isBold = function() {
return this._bold;
};
/**
* Set bold for the object text.
* @param enable {boolean} true to have a bold text, false otherwise.
*/
gdjs.TextRuntimeObject.prototype.setBold = function(enable) {
this._bold = enable;
this._renderer.updateStyle();
};
/**
* Return true if the text is italic.
*/
gdjs.TextRuntimeObject.prototype.isItalic = function() {
return this._italic;
};
/**
* Set italic for the object text.
* @param enable {boolean} true to have an italic text, false otherwise.
*/
gdjs.TextRuntimeObject.prototype.setItalic = function(enable) {
this._italic = enable;
this._renderer.updateStyle();
};
/**
* Get width of the text.
*/
gdjs.TextRuntimeObject.prototype.getWidth = function() {
return this._renderer.getWidth();
};
/**
* Get height of the text.
*/
gdjs.TextRuntimeObject.prototype.getHeight = function() {
return this._renderer.getHeight();
};
/**
* Get scale of the text.
*/
gdjs.TextRuntimeObject.prototype.getScale = function() {
return (Math.abs(this._scaleX)+Math.abs(this._scaleY))/2.0;
};
/**
* Get y-scale of the text.
*/
gdjs.TextRuntimeObject.prototype.getScaleX = function() {
return this._renderer.getScaleX();
};
/**
* Get x-scale of the text.
*/
gdjs.TextRuntimeObject.prototype.getScaleY = function() {
return this._renderer.getScaleY();
};
/**
* Set the text object scale.
* @param {number} newScale The new scale for the text object.
*/
gdjs.TextRuntimeObject.prototype.setScale = function(newScale) {
this._scaleX = newScale;
this._scaleY = newScale;
this._renderer.setScale(newScale);
};
/**
* Set the text object x-scale.
* @param {number} newScale The new x-scale for the text object.
*/
gdjs.TextRuntimeObject.prototype.setScaleX = function(newScale) {
this._scaleX = newScale;
this._renderer.setScaleX(newScale);
};
/**
* Set the text object y-scale.
* @param {number} newScale The new y-scale for the text object.
*/
gdjs.TextRuntimeObject.prototype.setScaleY = function(newScale) {
this._scaleY = newScale;
this._renderer.setScaleY(newScale);
};
/**
* Change the text color.
* @param {String} color color as a "R;G;B" string, for example: "255;0;0"
*/
gdjs.TextRuntimeObject.prototype.setColor = function(str) {
var color = str.split(";");
if ( color.length < 3 ) return;
this._color[0] = parseInt(color[0], 10);
this._color[1] = parseInt(color[1], 10);
this._color[2] = parseInt(color[2], 10);
this._useGradient = false;
this._renderer.updateStyle();
};
/**
* Get the text color.
* @return {String} The color as a "R;G;B" string, for example: "255;0;0"
*/
gdjs.TextRuntimeObject.prototype.getColor = function(str) {
return this._color[0] + ";" + this._color[1] + ";" + this._color[2];
};
/**
* Set the text alignment for multiline text objects.
* @param {string} alignment The text alignment.
*/
gdjs.TextRuntimeObject.prototype.setTextAlignment = function(alignment) {
this._textAlign = alignment;
this._renderer.updateStyle();
};
/**
* Get the text alignment of text object.
* @return {string} The text alignment.
*/
gdjs.TextRuntimeObject.prototype.getTextAlignment = function() {
return this._textAlign;
};
/**
* Return true if word wrapping is enabled for the text.
*/
gdjs.TextRuntimeObject.prototype.isWrapping = function() {
return this._wrapping;
};
/**
* Set word wrapping for the object text.
* @param {boolean} enable true to enable word wrapping, false to disable it.
*/
gdjs.TextRuntimeObject.prototype.setWrapping = function(enable) {
this._wrapping = enable;
this._renderer.updateStyle();
};
/**
* Get the word wrapping width for the text object.
*/
gdjs.TextRuntimeObject.prototype.getWrappingWidth = function() {
return this._wrappingWidth;
};
/**
* Set the word wrapping width for the text object.
* @param {number} width The new width to set.
*/
gdjs.TextRuntimeObject.prototype.setWrappingWidth = function(width) {
if (width <= 1) width = 1;
this._wrappingWidth = width;
this._renderer.updateStyle();
};
/**
* Set the outline for the text object.
* @param {string} str color as a "R;G;B" string, for example: "255;0;0"
* @param {number} thickness thickness of the outline (0 = disabled)
*/
gdjs.TextRuntimeObject.prototype.setOutline = function(str, thickness) {
var color = str.split(";");
if ( color.length < 3 ) return;
this._outlineColor[0] = parseInt(color[0], 10);
this._outlineColor[1] = parseInt(color[1], 10);
this._outlineColor[2] = parseInt(color[2], 10);
this._outlineThickness = thickness;
this._renderer.updateStyle();
};
/**
* Set the shadow for the text object.
* @param {string} str color as a "R;G;B" string, for example: "255;0;0"
* @param {number} distance distance between the shadow and the text, in pixels.
* @param {number} blur amout of shadow blur, in pixels.
* @param {number} angle shadow offset direction, in degrees.
*/
gdjs.TextRuntimeObject.prototype.setShadow = function(str, distance, blur, angle) {
var color = str.split(";");
if ( color.length < 3 ) return;
this._shadowColor[0] = parseInt(color[0], 10);
this._shadowColor[1] = parseInt(color[1], 10);
this._shadowColor[2] = parseInt(color[2], 10);
this._shadowDistance = distance;
this._shadowBlur = blur;
this._shadowAngle = angle;
this._shadow = true;
this._renderer.updateStyle();
};
/**
* Set the gradient for the text object.
* @param {string} strFirstColor color as a "R;G;B" string, for example: "255;0;0"
* @param {string} strSecondColor color as a "R;G;B" string, for example: "255;0;0"
* @param {string} strThirdColor color as a "R;G;B" string, for example: "255;0;0"
* @param {string} strFourthColor color as a "R;G;B" string, for example: "255;0;0"
* @param {string} strGradientType gradient type
*/
gdjs.TextRuntimeObject.prototype.setGradient = function(strGradientType, strFirstColor, strSecondColor, strThirdColor, strFourthColor) {
var colorFirst = strFirstColor.split(";");
var colorSecond = strSecondColor.split(";");
var colorThird = strThirdColor.split(";");
var colorFourth = strFourthColor.split(";");
this._gradient = [];
if (colorFirst.length == 3){
this._gradient.push([
parseInt(colorFirst[0], 10),
parseInt(colorFirst[1], 10),
parseInt(colorFirst[2], 10)
]);
}
if (colorSecond.length == 3){
this._gradient.push([
parseInt(colorSecond[0], 10),
parseInt(colorSecond[1], 10),
parseInt(colorSecond[2], 10)
]);
}
if (colorThird.length == 3){
this._gradient.push([
parseInt(colorThird[0], 10),
parseInt(colorThird[1], 10),
parseInt(colorThird[2], 10)
]);
}
if (colorFourth.length == 3){
this._gradient.push([
parseInt(colorFourth[0], 10),
parseInt(colorFourth[1], 10),
parseInt(colorFourth[2], 10)
]);
}
this._gradientType = strGradientType;
this._useGradient = (this._gradient.length > 1) ? true : false;
this._renderer.updateStyle();
};
/**
* Show the shadow of the text object.
* @param {boolean} enable true to show the shadow, false to hide it
*/
gdjs.TextRuntimeObject.prototype.showShadow = function(enable) {
this._shadow = enable;
this._renderer.updateStyle();
};
/**
* Get padding of the text object.
* @return {number} number of pixels around the text before it gets cropped
*/
gdjs.TextRuntimeObject.prototype.getPadding = function() {
return this._padding;
};
/**
* Set padding of the text object.
* @param {number} value number of pixels around the text before it gets cropped
*/
gdjs.TextRuntimeObject.prototype.setPadding = function(value) {
this._padding = value;
this._renderer.updateStyle();
};

BIN
games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Festa-di-Laurea-piena-da-convertire.ogg

Binary file not shown.

BIN
games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Fire Empty.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

BIN
games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Fire.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

BIN
games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Fuoco 2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Fuoco 3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

BIN
games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Fuoco 4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Fuoco.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

BIN
games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/GDevelop.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Gioca ancora.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
games.gdevelop-app.com/vincenzo/game-adbfc30b-3d8b-43b1-87ab-07f330a01272/Gioca.png

Binary file not shown.