X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=plugins%2Fdali-script-v8%2Fsrc%2Factors%2Factor-api.cpp;h=d068554dd51dd102a6856c36b7ee1ecab914c322;hp=ebc1fa7129e577cfb0a54e787f5b2eb80188529d;hb=070dc0823710d9776fb368151f0a9e4d82bdf158;hpb=4c85a797e24c20bfb1670c079e5f66a9a5d6fa0e diff --git a/plugins/dali-script-v8/src/actors/actor-api.cpp b/plugins/dali-script-v8/src/actors/actor-api.cpp index ebc1fa7..d068554 100644 --- a/plugins/dali-script-v8/src/actors/actor-api.cpp +++ b/plugins/dali-script-v8/src/actors/actor-api.cpp @@ -335,39 +335,6 @@ void ActorApi::FindChildByName( const v8::FunctionCallbackInfo& args } /** - * Search through this actor's hierarchy for an actor with the given name or alias. - * - * Actors can customize this function to provide actors with preferred alias' - * For example 'previous' could return the last selected child. - * If no aliased actor is found then FindChildByName() is called. - * - * @for Actor - * @method findChildByAlias - * @param {String} actor alias - * @return {Object} actor on success, empty actor handle if not found - */ -void ActorApi::FindChildByAlias( const v8::FunctionCallbackInfo& args ) -{ - v8::Isolate* isolate = args.GetIsolate(); - v8::HandleScope handleScope( isolate ); - Actor parent = GetActor( isolate, args ); - bool found( false ); - std::string name = V8Utils::GetStringParameter( PARAMETER_0, found, isolate, args ); - if( !found ) - { - DALI_SCRIPT_EXCEPTION( isolate, "String parameter not found" ); - return; - } - Actor childActor = parent.FindChildByAlias( name ); - if( childActor ) - { - // wrap the child - v8::Local < v8::Object > wrappedLayer = ActorWrapper::WrapActor( isolate, childActor ); - args.GetReturnValue().Set( wrappedLayer ); - } -} - -/** * Search through this actor's hierarchy for an actor with the given unique ID. * The actor itself is also considered in the search * @@ -535,13 +502,13 @@ void ActorApi::GetActorType( const v8::FunctionCallbackInfo& args ) * @example * * // using an array - * actor.moveBy( [20,40,0] ); + * actor.translateBy( [20,40,0] ); * * @for Actor - * @method moveBy + * @method translateBy * @param {object} an array of 3 numbers */ -void ActorApi::MoveBy( const v8::FunctionCallbackInfo& args ) +void ActorApi::TranslateBy( const v8::FunctionCallbackInfo& args ) { v8::Isolate* isolate = args.GetIsolate(); v8::HandleScope handleScope( isolate ); @@ -565,7 +532,7 @@ void ActorApi::MoveBy( const v8::FunctionCallbackInfo& args ) DALI_SCRIPT_EXCEPTION( isolate, "Vector3 move parameter missing" ); return; } - actor.MoveBy( vector ); + actor.TranslateBy( vector ); } @@ -641,74 +608,6 @@ void ActorApi::ScaleBy( const v8::FunctionCallbackInfo& args ) } actor.ScaleBy( vector ); } -/** - * Apply a relative scale to an actor. - * Actor opacity ranges from 0 (see through ) to 1 ( solid ) - * @example - * // reduce actor opactiy by a half - * actor.opaictyBy(-0.5); - * - * @for Actor - * @method OpacityBy - * @param {float} relative opacity - */ -void ActorApi::OpacityBy( const v8::FunctionCallbackInfo& args ) -{ - v8::Isolate* isolate = args.GetIsolate(); - v8::HandleScope handleScope( isolate ); - Actor actor = GetActor( isolate, args ); - - // void OpacityBy(float relativeOpacity); - bool found; - float opacity = V8Utils::GetFloatParameter( PARAMETER_0, found, isolate, args, 0.f ); - if( !found ) - { - DALI_SCRIPT_EXCEPTION( isolate, "float parameter missing" ); - return; - } - actor.OpacityBy( opacity ); -} - -/** - * Apply a relative color change to an actor. - * - * @example - * // increase actor red by half - * actor.colorBy( [0.5, 0, 0, 0]); - * - * - * @for Actor - * @method colorBy - * @param {Object} Color JavaScript array - */ -void ActorApi::ColorBy( const v8::FunctionCallbackInfo& args ) -{ - v8::Isolate* isolate = args.GetIsolate(); - v8::HandleScope handleScope( isolate ); - Actor actor = GetActor( isolate, args ); - - bool found; - int argCount( args.Length() ); - Vector4 color; - - if( argCount == 1 ) - { - color = V8Utils::GetVector4Parameter( PARAMETER_0, found, isolate, args ); - if( !found ) - { - DALI_SCRIPT_EXCEPTION( isolate, "Vector4 parameter missing" ); - return; - } - } - else - { - DALI_SCRIPT_EXCEPTION( isolate, "Vector4 parameter missing" ); - return; - } - - actor.ColorBy( color ); -} - } // namespace V8Plugin