Added Arc rendering and fixed version numbers

This commit is contained in:
Richard Davey 2018-09-05 16:50:33 +01:00
parent 9f9043d881
commit 40a53f75b7
6 changed files with 35 additions and 17 deletions

View file

@ -0,0 +1,26 @@
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2018 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* Renders this Game Object with the Canvas Renderer to the given Camera.
* The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.
* This method should not be called directly. It is a utility function of the Render module.
*
* @method Phaser.GameObjects.Arc#renderCanvas
* @since 3.13.0
* @private
*
* @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.
* @param {Phaser.GameObjects.Arc} src - The Game Object being rendered in this call.
* @param {number} interpolationPercentage - Reserved for future use and custom pipelines.
* @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.
* @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested
*/
var ArcCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)
{
};
module.exports = ArcCanvasRenderer;

View file

@ -14,7 +14,7 @@ if (typeof WEBGL_RENDERER)
if (typeof CANVAS_RENDERER)
{
// renderCanvas = require('./RectangleCanvasRenderer');
renderCanvas = require('./ArcCanvasRenderer');
}
module.exports = {

View file

@ -9,19 +9,18 @@
* The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.
* This method should not be called directly. It is a utility function of the Render module.
*
* @method Phaser.GameObjects.Image#renderCanvas
* @since 3.0.0
* @method Phaser.GameObjects.Rectangle#renderCanvas
* @since 3.13.0
* @private
*
* @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.
* @param {Phaser.GameObjects.Image} src - The Game Object being rendered in this call.
* @param {Phaser.GameObjects.Rectangle} src - The Game Object being rendered in this call.
* @param {number} interpolationPercentage - Reserved for future use and custom pipelines.
* @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.
* @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested
*/
var RectangleCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)
{
renderer.batchSprite(src, src.frame, camera, parentMatrix);
};
module.exports = RectangleCanvasRenderer;

View file

@ -13,8 +13,8 @@ var Rectangle = require('./Rectangle');
*
* Note: This method will only be available if the Zone Game Object has been built into Phaser.
*
* @method Phaser.GameObjects.GameObjectCreator#zone
* @since 3.0.0
* @method Phaser.GameObjects.GameObjectCreator#rectangle
* @since 3.13.0
*
* @param {object} config - The configuration object this Game Object will use to create itself.
*

View file

@ -9,19 +9,18 @@
* The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.
* This method should not be called directly. It is a utility function of the Render module.
*
* @method Phaser.GameObjects.Image#renderCanvas
* @since 3.0.0
* @method Phaser.GameObjects.Triangle#renderCanvas
* @since 3.13.0
* @private
*
* @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.
* @param {Phaser.GameObjects.Image} src - The Game Object being rendered in this call.
* @param {Phaser.GameObjects.Triangle} src - The Game Object being rendered in this call.
* @param {number} interpolationPercentage - Reserved for future use and custom pipelines.
* @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.
* @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested
*/
var RectangleCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)
{
renderer.batchSprite(src, src.frame, camera, parentMatrix);
};
module.exports = RectangleCanvasRenderer;

View file

@ -42,17 +42,11 @@ var TriangleWebGLRenderer = function (renderer, src, interpolationPercentage, ca
// Undo the camera scroll
shapeMatrix.e = src.x;
shapeMatrix.f = src.y;
// Multiply by the Sprite matrix, store result in calcMatrix
// camMatrix.multiply(shapeMatrix);
}
else
{
shapeMatrix.e -= camera.scrollX * src.scrollFactorX;
shapeMatrix.f -= camera.scrollY * src.scrollFactorY;
// Multiply by the Sprite matrix, store result in calcMatrix
// camMatrix.multiply(shapeMatrix);
}
var alpha = camera.alpha * src.alpha;