Incorperating some code


  • Posts: 161
I was wondering if someone could help me incorperate some code into stencyl I tried putting it in a normal scene behaviour in a code block but would not work. The code is
Code: [Select]
import sandy.core.Scene3D;
import sandy.core.scenegraph.*;
import sandy.primitive.*;
// -- creation of the scene. You give it a container, a camera and a root group to add your object into.
var scene:Scene3D = new Scene3D( "myScene", this, new Camera3D( 550, 400 ), new Group("root") );
// -- you add an object to the scene you've just created
scene.root.addChild(new Sphere( "mySphere" ) );
// -- and you ask the scene to render


  • *
  • Posts: 4643
The library "sandy" that you're trying to import has to be somewhere where the compiler can find it and I'm not certain where that exact location is within Stencyl's file system. That might be part of the problem.

The second problem might be that a scene behavior is at a much higher level (in terms of code type) than than the Flash stage which you would probably want to add your Scene3D object to. I suspect that you'd have to reference the Flash stage to do so - but at that point you're going back to coding in AS3 instead of in Stencyl or even Flixel.
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.


  • Posts: 161
Thanks for giving me a answer. This seems more complicated then I thought I will proberly have to just leave it. Although I did have the libary added.


  • Posts: 262
If you want sandy to work along-side flixel/stencyl, I think you might need to make sandy render into a bitmap buffer which you then copy to the screen buffer. I'm not sure its possible, and I'm not sure it's what you want to do ?