Jump to content

Search the Community

Showing results for tags 'definition file'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 2 results

  1. Hello guys! I am currently working with @troyedwardsjr (https://github.com/troyedwardsjr/phaser3-typescript-webpack) typescript definition file, because I couldn't find any other. However, this one seems to be still incomplete at the moment. According to the last dev Log Issue 117, the typescript definition file should be released soon. Before I support the development of that one, I wanted to ask when the official typescript definition file is going to be released? Any way I can support you guys here?
  2. Hi, i'm using this file in my project : /*Copyright © 2013 Marian Euent Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS INTHE SOFTWARE.*//* @param {Object} object: Any object you want to tween. For example: PIXI.Sprite @param {String} property: the property which needs to be changed. Use "property.property.property..." if the property is little deeper. Pass "" to create a Wait-Tween @param {float} value: targetValue of tweening @param {int} frames: duration of the tween in frames. @param {boolean} autostart: starting when created? Set to false if you use it with ChainedTween use examples: new Tween(sprite, "position.x", 100, 60, true); new Tween(sprite.position, "x", 100, 60, true); */function Tween(object, property, value, frames, autostart) { this.object = object; var properties = property.split("."); this.property = properties[properties.length - 1]; for (var i = 0; i < properties.length - 1; i++) { this.object = this.object[properties]; } this.targetValue = value; this.startValue; this.active = autostart; this.currentFrame = 0; this.endFrame = frames; this.onComplete; this.onCompleteParams; this.easing = Tween.noEase; Tween.tweens.push(this);}Tween.noEase = function (t, b, c, d) { t /= d; return b + c * (t);};Tween.prototype.setOnComplete = function (callback, parameters) { this.onComplete = callback; this.onCompleteParams = parameters;};Tween.prototype.start = function () { this.active = true;};Tween.prototype.initIterations = function () { if (this.property != "") { this.startValue = this.object[this.property]; this.targetValue = this.targetValue - this.object[this.property]; }};Tween.prototype.update = function () { if (!this.active) { return false; } if (this.currentFrame == 0) { this.initIterations(); } this.currentFrame++; if (this.currentFrame <= this.endFrame) { if (this.property != "") { var oldValue = this.object[this.property]; var newValue = this.easing(this.currentFrame, this.startValue, this.targetValue, this.endFrame); this.object[this.property] = newValue; } return false; } else { this.active = false; if (this.onComplete != null) { this.onComplete(this.onCompleteParams); } return true; }};Tween.tweens = [];// Call this every Frame of your Game/Application to keep the tweens running.Tween.runTweens = function () { for (var i = 0; i < Tween.tweens.length; i++) { var tween = Tween.tweens; if (tween.update()) { var index = Tween.tweens.indexOf(tween); if (index != -1) { Tween.tweens.splice(index, 1); } i--; } }};// EASING// use example:// var tween = new Tween(sprite, "alpha", 0, 60, true);// tween.easing = Tween.outElastic;Tween.outElastic = function (t, b, c, d) { var ts = (t /= d) * t; var tc = ts * t; return b + c * (33 * tc * ts + -106 * ts * ts + 126 * tc + -67 * ts + 15 * t);};Tween.inElastic = function (t, b, c, d) { var ts = (t /= d) * t; var tc = ts * t; return b + c * (56 * tc * ts + -105 * ts * ts + 60 * tc + -10 * ts);};Tween.inOutQuintic = function (t, b, c, d) { var ts = (t /= d) * t; var tc = ts * t; return b + c * (6 * tc * ts + -15 * ts * ts + 10 * tc);};Tween.inQuintic = function (t, b, c, d) { var ts = (t /= d) * t; var tc = ts * t; return b + c * (tc * ts);};Tween.outQuintic = function (t, b, c, d) { var ts = (t /= d) * t; var tc = ts * t; return b + c * (tc * ts + -5 * ts * ts + 10 * tc + -10 * ts + 5 * t);};Tween.inCubic = function (t, b, c, d) { var tc = (t /= d) * t * t; return b + c * (tc);};Tween.inOutCubic = function (t, b, c, d) { var ts = (t /= d) * t; var tc = ts * t; return b + c * (-2 * tc + 3 * ts);};Tween.outCubic = function (t, b, c, d) { var ts = (t /= d) * t; var tc = ts * t; return b + c * (tc + -3 * ts + 3 * t);};// CHAINED TWEEN/* @param {Array} tweens: Array of Tweens. example: var tween1 = new Tween(sprite, "position.x", 100, 60, false); var tween2 = new Tween(sprite, "position.x", 0, 60, false); new ChainedTween([tween1, tween2]);*/function ChainedTween(tweens) { this.tweens = tweens; Tween.tweens.push(this);}ChainedTween.prototype.update = function () { if (this.tweens.length == 0) { return true; } var currentTween = this.tweens[0]; if (!currentTween.active) { currentTween.start(); } var finished = currentTween.update(); if (finished) { this.tweens.splice(0, 1); } return false;};// TODO: COMBINED TWEENfunction CombinedTween(tweens) {}CombinedTween.prototype.start = function () {};CombinedTween.prototype.update = function () {}; I have created the following defintion file : /** * * Typescript declaration file for tween.js file * User: Marwane * Date: 09/04/15 */ declare var TWEEN: any;declare module TWEEN_ {export class Tween {object:any;property:string;targetValue:number;startValue:string;active:boolean;currentFrame:number;endFrame:number;tweens:any[]; constructor( object:any, property:string, value:number, frames:number, autostart:boolean); public onComplete:()=>void;public setOnComplete:()=>void;public start:()=>void;public initIterations:()=>void;public update:()=>void;public runTweens:()=>void;public noEase:()=>void;public outElastic:()=>void;public inElastic:()=>void;public inOutQuintic:()=>void;public inQuintic:()=>void;public outQuintic:()=>void;public inCubic:()=>void;public inOutCubic:()=>void;public outCubic:()=>void;} export class ChainedTween{tweens:any[]; constructor(tweens:any[]); public update:()=>void; } } it compiles, however when i run the code i get "Uncaught ReferenceError: TWEEN_ is not defined" Please help me Thanks in advance
×
×
  • Create New...