Rafus Posted October 18, 2013 Share Posted October 18, 2013 Hi,I'm having a problem with using TweenLite. Is there any way to use it with phaser? Link to comment Share on other sites More sharing options...
rich Posted October 18, 2013 Share Posted October 18, 2013 You need to tell us what the error is and show some code. At the moment it's like trying to debug thin air. RestingCoder 1 Link to comment Share on other sites More sharing options...
Rafus Posted October 19, 2013 Author Share Posted October 19, 2013 Hi,If you import in your html :<!DOCTYPE html><html><head> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script src="Lib/Intro.js"></script> <script src="Lib/pixi/Pixi.js"></script> <script src="Lib/Phaser.js"></script> <script src="Lib/utils/Utils.js"></script> <script src="Lib/pixi/core/Matrix.js"></script> <script src="Lib/pixi/core/Point.js"></script> <script src="Lib/pixi/core/Rectangle.js"></script> <script src="Lib/pixi/display/DisplayObject.js"></script> <script src="Lib/pixi/display/DisplayObjectContainer.js"></script> <script src="Lib/pixi/display/Sprite.js"></script> <script src="Lib/pixi/display/Stage.js"></script> <script src="Lib/pixi/extras/CustomRenderable.js"></script> <script src="Lib/pixi/extras/Strip.js"></script> <script src="Lib/pixi/extras/Rope.js"></script> <script src="Lib/pixi/extras/TilingSprite.js"></script> <script src="Lib/pixi/filters/FilterBlock.js"></script> <script src="Lib/pixi/filters/MaskFilter.js"></script> <script src="Lib/pixi/primitives/Graphics.js"></script> <script src="Lib/pixi/renderers/canvas/CanvasGraphics.js"></script> <script src="Lib/pixi/renderers/canvas/CanvasRenderer.js"></script> <script src="Lib/pixi/renderers/webgl/WebGLBatch.js"></script> <script src="Lib/pixi/renderers/webgl/WebGLGraphics.js"></script> <script src="Lib/pixi/renderers/webgl/WebGLRenderer.js"></script> <script src="Lib/pixi/renderers/webgl/WebGLRenderGroup.js"></script> <script src="Lib/pixi/renderers/webgl/WebGLShaders.js"></script> <script src="Lib/pixi/text/BitmapText.js"></script> <script src="Lib/pixi/text/Text.js"></script> <script src="Lib/pixi/textures/BaseTexture.js"></script> <script src="Lib/pixi/textures/Texture.js"></script> <script src="Lib/pixi/textures/RenderTexture.js"></script> <script src="Lib/pixi/utils/EventTarget.js"></script> <script src="Lib/pixi/utils/Polyk.js"></script> <script src="Lib/core/Camera.js"></script> <script src="Lib/core/State.js"></script> <script src="Lib/core/StateManager.js"></script> <script src="Lib/core/LinkedList.js"></script> <script src="Lib/core/Signal.js"></script> <script src="Lib/core/SignalBinding.js"></script> <script src="Lib/core/Plugin.js"></script> <script src="Lib/core/PluginManager.js"></script> <script src="Lib/core/Stage.js"></script> <script src="Lib/core/Group.js"></script> <script src="Lib/core/World.js"></script> <script src="Lib/core/Game.js"></script> <script src="Lib/input/Input.js"></script> <script src="Lib/input/Keyboard.js"></script> <script src="Lib/input/Mouse.js"></script> <script src="Lib/input/MSPointer.js"></script> <script src="Lib/input/Pointer.js"></script> <script src="Lib/input/Touch.js"></script> <script src="Lib/input/InputHandler.js"></script> <script src="Lib/gameobjects/Events.js"></script> <script src="Lib/gameobjects/GameObjectFactory.js"></script> <script src="Lib/gameobjects/Sprite.js"></script> <script src="Lib/gameobjects/TileSprite.js"></script> <script src="Lib/gameobjects/Text.js"></script> <script src="Lib/gameobjects/BitmapText.js"></script> <script src="Lib/gameobjects/Button.js"></script> <script src="Lib/gameobjects/Graphics.js"></script> <script src="Lib/gameobjects/RenderTexture.js"></script> <script src="Lib/system/Canvas.js"></script> <script src="Lib/system/StageScaleMode.js"></script> <script src="Lib/system/Device.js"></script> <script src="Lib/system/RequestAnimationFrame.js"></script> <script src="Lib/math/RandomDataGenerator.js"></script> <script src="Lib/math/Math.js"></script> <script src="Lib/math/QuadTree.js"></script> <script src="Lib/geom/Circle.js"></script> <script src="Lib/geom/Point.js"></script> <script src="Lib/geom/Rectangle.js"></script> <script src="Lib/net/Net.js"></script> <script src="Lib/tween/TweenManager.js"></script> <script src="Lib/tween/Tween.js"></script> <script src="Lib/tween/Easing.js"></script> <script src="Lib/time/Time.js"></script> <script src="Lib/animation/AnimationManager.js"></script> <script src="Lib/animation/Animation.js"></script> <script src="Lib/animation/Frame.js"></script> <script src="Lib/animation/FrameData.js"></script> <script src="Lib/animation/Parser.js"></script> <script src="Lib/loader/Cache.js"></script> <script src="Lib/loader/Loader.js"></script> <script src="Lib/loader/Parser.js"></script> <script src="Lib/sound/Sound.js"></script> <script src="Lib/sound/SoundManager.js"></script> <script src="Lib/utils/Debug.js"></script> <script src="Lib/utils/Color.js"></script> <script src="Lib/physics/arcade/ArcadePhysics.js"></script> <script src="Lib/physics/arcade/Body.js"></script> <script src="Lib/particles/Particles.js"></script> <script src="Lib/particles/arcade/ArcadeParticles.js"></script> <script src="Lib/particles/arcade/Emitter.js"></script> <script src="Lib/tilemap/Tilemap.js"></script> <script src="Lib/tilemap/TilemapLayer.js"></script> <script src="Lib/tilemap/Tile.js"></script> <script src="Lib/tilemap/TilemapRenderer.js"></script> <script src="com/app/Const.js"></script> <script src="com/app/Main.js"></script> <script src="com/app/GuessTitleLevel.js"></script> <script src="com/app/DataHandler.js"></script> <script src="greensock/CSSPlugin.min.js"></script> <script src="greensock/EasePack.min.js"></script> <script src="greensock/TweenLite.min.js"></script> <link href="css/style.css" rel="stylesheet"> <link href="css/fonts.css" rel="stylesheet"> <meta charset="UTF-8"></head><body> <div id="top"> <a onclick="window.close()" id="x"></a> <a onclick="window.history.back()" id="home"></a> </div> <div id="content"> <h1>Navigare necesse est</h1> </div> <script type="text/javascript"> function boot() { var game = new Phaser.Game(1024, 700, Phaser.AUTO, "content"); game.state.add('boot', Main.Boot,true); game.state.add('preloader', Main.Preloader); game.state.add('guessTitleLevel', GuessTitleLevel.Game); } window.onload = function () { boot(); } </script> ></body></html>you will get this error when you open it in fire fox.Error that i recived says: "TypeError: Number is not a function" in tweenlite, but if i try tu use Tweenlite without phaser then it works. Link to comment Share on other sites More sharing options...
Rafus Posted October 19, 2013 Author Share Posted October 19, 2013 And one more question,The game I'm making it will be put on cd and played offline in chromium.I was testing it on chromium and there was no graphic only green boxes Any solution for this problem? Link to comment Share on other sites More sharing options...
Mike Posted October 20, 2013 Share Posted October 20, 2013 The game I'm making it will be put on cd and played offline in chromium. The engine needs web server to work. http://phaser.io/getting-started-js.php As obvious as this may sound, when you make HTML5 games you are making games for a web browser, and as such you have to work within the security restrictions of those browsers. One such restriction is that a browser cannot access your local file system by default. This is a good thing! After all, think of the potential repurcusions if it could. But what it means is that you can't just drag a Phaser HTML file onto your browser and expect it to run. The file will need to be served from a web server if you want it to be able to load in resources like images or music. But that server can easily run locally and that's how we develop all of our games here. You can't distribute HTML5 game to be played on CD.. at least not with phaser... and maybe if your game use only visual elements generated and drawn with code... Link to comment Share on other sites More sharing options...
rich Posted October 24, 2013 Share Posted October 24, 2013 Just to say that TweenLite/Max works fine with Phaser 1.1. I inserted the lib into the html and made a simple test case and it runs fine:var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create });function preload() { game.load.image('ball', 'assets/sprites/yellow_ball.png');}var ball;function create() { ball = game.add.sprite(300, 0, 'ball'); TweenLite.to(ball, 10, { y: 400 }); } Link to comment Share on other sites More sharing options...
ooflorent Posted October 24, 2013 Share Posted October 24, 2013 You can't distribute HTML5 game to be played on CD.. at least not with phaser... and maybe if your game use only visual elements generated and drawn with code... Wrong! Assets could be base64 encoded to solve CORS issues.Moreover, the CD can boot a small web server Link to comment Share on other sites More sharing options...
onedayitwillmake Posted October 24, 2013 Share Posted October 24, 2013 I'm using tweenlite on a current project without issue, in fact I found it to be slightly more performant (which makes sense since phaser is doing some things to handle Tweens if the game is paused etc that using Tweenlite doesn't do as it is does not know or care what context it is run from) Link to comment Share on other sites More sharing options...
CrazySam Posted October 24, 2013 Share Posted October 24, 2013 You can't distribute HTML5 game to be played on CD.. at least not with phaser... and maybe if your game use only visual elements generated and drawn with code... This isn't true, a simple google search reveals that there are already several ways of doing this. Link to comment Share on other sites More sharing options...
Recommended Posts