daily pastebin goal
32%
SHARE
TWEET

Untitled

a guest Dec 7th, 2018 94 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         private function onGenome2DInitialized():void
  2.         {
  3.             var bitmapData:BitmapData = new BitmapData(32, 32, false, 0xFF0000);
  4.             var texture:GTexture = GTextureFactory.createFromBitmapData("textureId", bitmapData, true);
  5.             texture.pivotX = -bitmapData.width/2;
  6.             texture.pivotY = -bitmapData.height/2;
  7.             var container:GNode = GNodeFactory.createNode("container");
  8.             Genome2D.getInstance().root.addChild(container);
  9.  
  10.             var sprite:GSprite = GNodeFactory.createNodeWithComponent(GSprite, "sprite") as GSprite;//G2DComponent.createWithNode(G2DSprite, "sprite") as G2DSprite;
  11.             sprite.setTexture(texture);
  12.             sprite.node.transform.x = stage.stageWidth / 2;
  13.             sprite.node.transform.y = stage.stageHeight / 2;
  14.             container.addChild(sprite.node);
  15.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top