namespace
{
-const char * gModelFile = DALI_MODEL_DIR "AlbumCute.dali-bin";
const char * const BACKGROUND_IMAGE( DALI_IMAGE_DIR "background-2.jpg" );
const char * const TOOLBAR_IMAGE( DALI_IMAGE_DIR "top-bar.png" );
const char * const LOSE_CONTEXT_IMAGE( DALI_IMAGE_DIR "icon-cluster-wobble.png" );
void CreateBubbles(Vector2 stageSize);
void CreateBlending();
void CreateText();
- void CreateModel();
- void OnModelLoaded(Model model);
bool OnTrackTimerTick();
bool OnExplodeTimerTick();
void SetUpAnimation( Vector2 emitPosition, Vector2 direction );
private:
Application mApplication;
- Animation mModelAnimation;
- Actor mModelActor;
Actor mCastingLight;
TextActor mTextActor;
ImageActor mImageActor;
ImageActor mBlendActor;
Image mEffectImage;
Image mBaseImage;
- LightActor mKeyLightActor;
MeshActor mMeshActor;
MeshActor mAnimatedMeshActor;
- Model mModel;
Toolkit::View mView; ///< The View instance.
Toolkit::ToolBar mToolBar; ///< The View's Toolbar.
CreateMeshActor();
CreateBlending();
CreateText();
- CreateModel();
stage.ContextLostSignal().Connect(this, &NewWindowController::OnContextLost);
stage.ContextRegainedSignal().Connect(this, &NewWindowController::OnContextRegained);
return mesh;
}
-void NewWindowController::CreateModel()
-{
- mModel = Model::New(gModelFile);
- mModel.LoadingFinishedSignal().Connect(this, &NewWindowController::OnModelLoaded);
-
- //Create a Key light
- Light keylight = Light::New("KeyLight");
- keylight.SetFallOff(Vector2(10000.0f, 10000.0f));
-
- mCastingLight = Actor::New();
- mCastingLight.SetParentOrigin(ParentOrigin::CENTER);
- mCastingLight.SetAnchorPoint(AnchorPoint::CENTER);
- mCastingLight.SetPosition( Vector3( 0.0f, 0.0f, 800.0f ) );
- mContentLayer.Add( mCastingLight );
-
- mKeyLightActor = LightActor::New();
- mKeyLightActor.SetParentOrigin(ParentOrigin::CENTER);
- mKeyLightActor.SetName(keylight.GetName());
-
- //Add all the actors to the stage
- mCastingLight.Add(mKeyLightActor);
- mKeyLightActor.SetLight(keylight);
-}
-
-void NewWindowController::OnModelLoaded( Model model )
-{
- if( model.GetLoadingState() == ResourceLoadingSucceeded )
- {
- std::cout << "Succeeded loading model" << std::endl;
- mModelActor = ModelActorFactory::BuildActorTree(mModel, ""); // Gets root actor
- mModelActor.SetSize(250.0f, 250.0f);
- mModelActor.SetPosition(0.0f, 200.0f, 70.0f);
- mModelActor.SetScale(0.5f);
- mModelActor.SetRotation(Radian(Math::PI*0.25f), Vector3(1.0, 0.7, 0.0));
-
- mContentLayer.Add( mModelActor );
-
- if (mModel.NumberOfAnimations())
- {
- mModelAnimation = ModelActorFactory::BuildAnimation(mModel, mModelActor, 0);
- mModelAnimation.SetDuration(4.0f);
- mModelAnimation.SetLooping(true);
- mModelAnimation.Play();
- }
- }
- else
- {
- std::cout << "Failed loading model" << std::endl;
- mApplication.Quit();
- }
-}
-
void NewWindowController::NewWindow(void)
{
PositionSize posSize(0, 0, 720, 1280);