X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=plugins%2Fdali-script-v8%2Fdocs%2Fcontent%2Factor.js;h=5ad21802a694b1f1697ee55dc88800cd32981c7d;hb=d8a62ef92f9ddecc199eb88ed7698194bc539662;hp=e2ce270f4c246cdd8e434a7ff3c2a2dfaf39dad9;hpb=8c31a5ca493d17693e53f9909a4453b1fa058ab3;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/plugins/dali-script-v8/docs/content/actor.js b/plugins/dali-script-v8/docs/content/actor.js index e2ce270..5ad2180 100644 --- a/plugins/dali-script-v8/docs/content/actor.js +++ b/plugins/dali-script-v8/docs/content/actor.js @@ -9,7 +9,6 @@ ``` var actor = new dali.Actor(); -var imageActor = new dali.ImageActor(); var textActor = new dali.TextActor("hello world"); var camera = new dali.CameraActor(); var layer = new dali.Layer(); @@ -72,60 +71,64 @@ Note that since DALi is a 3D toolkit, this behaviour is the result of a default The actor provides the following call back events -| Name | Description | Parameters passed to call back | -|-------------------|----------------------------------------|--------------------------| -|touched | touch event | (actor, touchEvent ) | -|hovered | mouse or pointer hovering over actor | (actor, hoverEvent) | -|mouse-wheel-event | mouse wheel events | (actor, wheelEvent) | -|on-stage | actor has been moved on stage | (actor) | -|off-stage | actor has been moved off stage | (actor) | +| Name | Description | Parameters passed to call back | +|-----------------|----------------------------------------|--------------------------| +|touch | touch | (actor, touchData ) | +|hovered | mouse or pointer hovering over actor | (actor, hoverEvent) | +|mouseWheelEvent | mouse wheel events | (actor, wheelEvent) | +|onStage | actor has been moved on stage | (actor) | +|offStage | actor has been moved off stage | (actor) | #### Touch event Used to detect multiple touch events on the actor. The state of each touch point can be: -+ "down" = touch down -+ "up" = Touch up -+ "motion" = Finger dragged or hovered -+ "leave" = Leave the boundary of an actor -+ "stationary" = No change from last event. Useful when a multi-point event occurs where -all points are sent but indicates that this particular point has not changed since the last time -+ "interrupted" = A system event has occurred which has interrupted the touch or hover event sequence ++ "DOWN" = touch down ++ "UP" = Touch up ++ "MOTION" = Finger dragged or hovered ++ "LEAVE" = Leave the boundary of an actor ++ "STATIONARY" = No change from last event. Useful when a multi-point event occurs where + all points are sent but indicates that this particular point has not changed + since the last time ++ "INTERRUPTED" = A system event has occurred which has interrupted the touch or hover event sequence ``` -touchEvent = { +touchData = { pointCount: int, // number of points touched ( multi-touch ) time: int, // The time in milliseconds that the touch event occurred. - points = [ touchPoints ], // array of TouchPoints, to support + points = [ Points ], // array of Points - TouchPoint = { - - "deviceId" : int, // Each touch point has a unique device ID - "state" : string, // touch state ="down,up,motion,leave,stationary, interrupted } - "sourceActor" : actor, // the actor that is emitting the callback (the actor that is hit maybe a child of it) - "hitActor" : actor, // actor that was hit - "local" : {x,y}, // co-ordinates of top left of hit actor (local.x, local.y) - "screen" : {x,y} // co-ordinates of top left of hit actor (screen.x, screen.y) - } + Point = { + "deviceId" : int, // Each touch point has a unique device ID + "state" : string, // touch state ="DOWN","UP","MOTION","LEAVE","STATIONARY","INTERRUPTED" + "sourceActor" : actor, // the actor that is emitting the callback (the actor that is hit maybe a child of it) + "hitActor" : actor, // actor that was hit + "local" : {x,y}, // co-ordinates of top left of hit actor (local.x, local.y) + "screen" : {x,y}, // co-ordinates of top left of hit actor (screen.x, screen.y) + "radius" : float, // radius of the press point (average of both the horizontal & vertical radii) + "ellipseRadius" : {x,y}, // both the horizontal and the vertical radii of the press point + "pressure" : float, // the touch pressure + "angle" : float // angle of the press point relative to the Y-Axis (in degrees) + } } -function OnPressed( actor, touchEvent ) +function onPressed( actor, touchData ) { - var firstPoint = touchEvent.points[0]; - log("first touch point = " + firstPoint.screen.x + "," +firstPoint.screen.x + "actor= "+firstPoint.hitActor ); + var firstPoint = touchData.points[0]; + log("first touch point = " + firstPoint.screen.x + "," + firstPoint.screen.x + "actor= " + firstPoint.hitActor ); var anim = new dali.Animation( 4 ); var rotation = new dali.Rotation( 90, 0, 0 ); // pitch, yaw, roll - anim.animateBy( actor, "rotation", rotation ); + anim.animateBy( actor, "orientation", rotation ); anim.play(); return true; } // connect to touch events -myActor.connect( "touched", onPressed ); +myActor.on( "touch", onPressed ); ``` @@ -139,12 +142,17 @@ hoverEvent = { points[] // array of TouchPoints TouchPoint = { - // See touchEvent TouchPoint object + "deviceId" : int, // Each touch point has a unique device ID + "state" : string, // touch state ="down,up,motion,leave,stationary, interrupted } + "sourceActor" : actor, // the actor that is emitting the callback (the actor that is hit maybe a child of it) + "hitActor" : actor, // actor that was hit + "local" : {x,y}, // co-ordinates of top left of hit actor (local.x, local.y) + "screen" : {x,y} // co-ordinates of top left of hit actor (screen.x, screen.y) } } ``` // connect to touch events - myActor.connect( "hovered", onHover); + myActor.on( "hovered", onHover); #### Mouse wheel event @@ -162,7 +170,7 @@ mouseWheelEvent = { } // connect to touch events -myActor.connect( "mouse-wheel-event", onMouseWheel ); +myActor.on( "mouseWheelEvent", onMouseWheel ); ``` #### Key events @@ -196,8 +204,8 @@ See worldPositionX |FLOAT | ✘ | ✘ worldPositionY |FLOAT | ✘ | ✘ worldPositionZ |FLOAT | ✘ | ✘ - rotation |ROTATION | ✔ | ✔ - worldRotation |ROTATION | ✘ | ✘ + orientation |ROTATION | ✔ | ✔ + worldOrientation |ROTATION | ✘ | ✘ scale |VECTOR3 | ✔ | ✔ scaleX |FLOAT | ✔ | ✔ scaleY |FLOAT | ✔ | ✔ @@ -214,7 +222,7 @@ See name |STRING | ✔ | ✘ sensitive |BOOLEAN | ✔ | ✘ leaveRequired |BOOLEAN | ✔ | ✘ - inheritRotation |BOOLEAN | ✔ | ✘ + inheritOrientation |BOOLEAN | ✔ | ✘ inheritScale |BOOLEAN | ✔ | ✘ colorMode |NUMBER | ✔ | ✘ positionInheritance |NUMBER | ✔ | ✘ @@ -382,19 +390,19 @@ WORLD_POSITION_Z /** - * Actors rotation - * @property rotation + * Actors orientation + * @property orientation * @type dali Rotation object */ -ROTATION +ORIENTATION /** - * Actors world-rotation - * @property worldRotation + * Actors world-orientation + * @property worldOrientation * @type dali Rotation object ( read only) */ -WORLD_ROTATION +WORLD_ORIENTATION /** * Actors scale @@ -488,9 +496,9 @@ WORLD_COLOR /** * Actors sensitive flag - * brief Sets whether an actor should emit touch event signals; @see SignalTouched(). + * brief Sets whether an actor should emit touch event signals; @see SignalTouch(). * - * An actor is sensitive by default, which means that as soon as an application connects to the SignalTouched(), + * An actor is sensitive by default, which means that as soon as an application connects to the SignalTouch(), * the touch event signal will be emitted. * * If the application wishes to temporarily disable the touch event signal emission, then they can do so by calling @@ -522,10 +530,10 @@ LEAVE_REQUIRED /** * Set whether a child actor inherits it's parent's orientation. * @type Boolean - * @property inheritRotation + * @property inheritOrientation * @default true */ -INHERIT_ROTATION, +INHERIT_ORIENTATION, /**