Skip navigation
Currently Being Moderated

Position x, y canvas - toolkit createjs

Apr 19, 2013 3:21 PM

Tags: #createjs #toolkit_for_createjs



As I can position in x & y. my animation on the canvas, for example 200px right or 100px top.





This is my code:


<!DOCTYPE html>



<meta charset="UTF-8">

<title>CreateJS export from cloud gc</title>


<script src="easeljs-0.6.0.min.js"></script>

<script src="tweenjs-0.4.0.min.js"></script>

<script src="movieclip-0.6.0.min.js"></script>

<script src="cloud gc.js"></script>



var canvas, stage, exportRoot;


function init() {

          canvas = document.getElementById("canvas");

          exportRoot = new lib.cloudgc();




          stage = new createjs.Stage(canvas);





          createjs.Ticker.addEventListener("tick", stage);







<body onload="init();" style="background-color:#D4D4D4">

          <canvas id="canvas" width="616" height="475" style="background-color:#ffffff"></canvas>



  • Currently Being Moderated
    Apr 20, 2013 4:06 PM   in reply to grandascreativos

    What are you trying to position? To move your entire animation over, you can set the x/y of the exportRoot. To move contents within the exportRoot, target them using their instance name from Flash Pro.  For example

    exportRoot.x = 100;
    // OR
    exportRoot.instance.x = 100;
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)