Cocos2D JavaScript (v0.2.0-beta) API Documentation

Class: ScaleTo

Module
cocos.actions
Defined In
actions/ActionInterval.js
Subclasses
ScaleBy
Extends
ActionInterval
ScaleTo Scales a cocos.Node object to a zoom factor by modifying it's scale attribute.

Public Properties

Property Defined By
Expand duration duration : Float
Number of seconds to run the Action for
FiniteTimeAction
Expand elapsed elapsed : Float
Number of seconds that have elapsed
ActionInterval
Expand endScaleX endScaleX : Float
Final X Scale
ScaleTo
Expand endScaleY endScaleY : Float
Final Y Scale
ScaleTo
Expand id id : Integer <read-only>
Unique ID for this object
BObject
Expand isDone isDone : * <read-only> Action
Expand scaleX scaleX : Float
Current X Scale
ScaleTo
Expand scaleY scaleY : Float
Current Y Scale
ScaleTo
Expand startScaleX startScaleX : Float
Initial X Scale
ScaleTo
Expand startScaleY startScaleY : Float
Initial Y Scale
ScaleTo
Expand tag tag : *
Unique tag to identify the action
Action
Expand target target : cocos.nodes.Node
The Node the action is being performed on
Action

Public Methods

Method Defined By
Expand ScaleTo new ScaleTo ({duration:Float,[scale:Float],[scaleX:Float],[scaleY:Float]}) : cocos.actions.ScaleTo <constructor>

Named Arguments

  • duration : Float
    Number of seconds to run action for
  • scale : Float (Optional)
    Size to scale Node to
  • scaleX : Float (Optional)
    Size to scale width of Node to
  • scaleY : Float (Optional)
    Size to scale height of Node to

Returns

ScaleTo
Expand bindTo bindTo (key:String,target:BOject,[targetKey:String],[noNotify:Boolean]) : void
Bind the value of a property on this object to that of another object so they always have the same value. Setting the value on either object will update the other too.

Arguments

  1. key : String
    Name of the property on this object that should be bound
  2. target : BOject
    Object to bind to
  3. targetKey : String (Optional)
    Key on the target object to bind to
  4. noNotify : Boolean (Optional)
    Set to true to prevent this object's property triggering a 'changed' event when adding the binding

Returns

  • void
BObject
Expand changed changed (key:*) : void

Arguments

  1. key :

Returns

  • void
BObject
Expand copy copy () : void

Returns

  • void
ScaleTo
Expand get get (key:String) : *
Get a property from the object. Always use this instead of trying to access the property directly. This will ensure all bindings, setters and getters work correctly.

Arguments

  1. key : String
    Name of property to get or dot (.) separated path to a property

Returns

  • *
    Value of the property
BObject
Expand get_isDone get_isDone () : void

Returns

  • void
ActionInterval
Expand reverse reverse () : void

Returns

  • void
ActionInterval
Expand set set (key:String,value:*) : void
Set a property on the object. Always use this instead of trying to access the property directly. This will ensure all bindings, setters and getters work correctly.

Arguments

  1. key : String
    Name of property to get
  2. value : *
    New value for the property

Returns

  • void
BObject
Expand setValues setValues (kvp:Object) : void
Set multiple propertys in one go

Arguments

  1. kvp : Object
    An Object where the key is a property name and the value is the value to assign to the property

Returns

  • void
BObject
Expand startWithTarget startWithTarget (target:*) : void

Arguments

  1. target :

Returns

  • void
ScaleTo
Expand step step (dt:*) : void

Arguments

  1. dt :

Returns

  • void
ActionInterval
Expand stop stop () : void
Called after the action has finished. It will set the 'target' to nil. Important: You should never call cocos.actions.Action#stop manually. Instead, use cocos.nodes.Node#stopAction(action)

Returns

  • void
Action
Expand unbind unbind (key:String) : void
Remove binding from a property which set setup using BObject#bindTo.

Arguments

  1. key : String
    Name of the property on this object to unbind

Returns

  • void
BObject
Expand unbindAll unbindAll () : void
Remove all bindings on this object

Returns

  • void
BObject
Expand update update (t:*) : void

Arguments

  1. t :

Returns

  • void
ScaleTo

Private Members

This class has no private members.