mirror of
https://github.com/4ian/GDevelop.git
synced 2025-10-15 10:19:04 +00:00
Add PanelSprite JavaScript function annotations (#637)
This commit is contained in:
@@ -59,38 +59,71 @@ gdjs.PanelSpriteRuntimeObject.prototype.extraInitializationFromInitialInstance =
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 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();
|
||||
|
Reference in New Issue
Block a user