Kinetic usage notes -- container

Source: Internet
Author: User

<Virtual> new Container (config)
Parameters:
Config: the object that contains all configuration items.
        

{X: "x coordinate", y: "y coordinate", width: "width", height: "height", visible: "visible, true by default", listening: "Whether it is in the event listening status; default value: false", id: "unique identifier", name: "name (not unique)", opacity: "blob transparency, value: 0-1 ", scale:" scale, which can be expressed by array [a, B] or object {x: a, y: B}. ", scaleX: "x scaling", scaleY: "y scaling", rotation: "rotation angle, unit: radian", rotationDeg: "rotation angle, unit: Angle", offset: "offset, which can be expressed by array [a, B] or object {x: a, y: B}", offsetX: "x offset", offsetY: "y offset ", draggable: "whether to enable the node drag function. The default value is false.", dragBoundFunc: "drag boundfunction", clipFunc: "Crop function "}

Method:

Add (child): add nodes to the container. Clear (): clears the current layer from the canvas. Currently not supported. Clone (attrs): clone node, which can overwrite attributes. Destroy (): remove and destroy nodes. Currently not supported. DestroyChildren (): removes and destroys subnodes. Currently not supported. Fire (eventType, evt, bubble): eventType: event type. Evt: event object. Bubble: whether to bubble, true/false. The default value is false. Get (selector): get the subnode. GetAbsoluteOpacity (): Get transparency. GetAbsolutePosition (): obtains the coordinates of the position relative to the upper left corner of the container. GetAbsoluteTransform (): Get the transformation object. GetAbsoluteZIndex (): gets a hierarchical index. Currently not supported. GetAllIntersections (pos): obtains all nodes that contain pos coordinates. GetAttr (attr): gets the attribute value of a specified attribute. GetAttrs (): Get the property object. GetCanvas (): Get the canvas Renderer. Currently not supported. GetChildren (): Get all child nodes. GetClassName (): Get type name. GetClearBeforeDraw (): determines whether the canvas is cleared before painting. GetClipFunc (): Get the cropping function. GetContext (): Get the canvas context. GetDragBoundFunc (): Get the boundfunction. GetDraggable (): Get the scalability. GetHeight (): Get the height. GetHitCanvas (): Get the collision canvas. GetId (): Get the id. GetLayer (): Get the layer where the node is located. GetLevel (): Get the node level. The stage level is 0, the layers level is 1, and the groups and shapes levels are> = 2. GetListening (): whether or not it is in the event listening status. GetName (): Get the name. GetOffset (): Get the offset value. GetOffsetX (): returns the x-axis offset. GetOffsetY (): obtains the y-axis offset value. GetOpacity (): Get transparency. GetParent (): Get the parent container. GetPosition (): gets the position relative to the parent node. GetRotation (): Get the rotation amplitude. GetRotationDeg (): Get the rotation angle. GetScale (): Get the scaling volume. GetScaleX (): Get the x-axis scaling. GetScaleY (): obtains the scale of the Y axis. GetSize (): Query size. GetSkew (): Query coordinates. GetSkewX (): query the abscissa. GetSkewY (): query the ordinate values. GetStage (): Get stage. GetTransform (): Get the node transformation object. GetType (): Get the node type. GetVisible (): detects node visibility. GetWidth (): Get the node width. GetX (): obtains the abscissa of a node. GetY (): Get the ordinate of a node. GetZIndex (): Get the level relative to the sibling node. HasChildren (): checks whether a subnode exists. Hide (): hides nodes. IsAncestorOf (node): determines whether the current node is the ancestor node of a node. IsDraggable (): checks whether nodes can be dragged. IsDraggable (): checks whether a node can be dragged. It is equivalent to getDraggable (). IsDragging (): checks whether a node is in the drag/drop mode. IsListening (): checks whether a node is currently in event listening mode, equivalent to getListening (). IsVisible (): detects node visibility, which is equivalent to getVisible (). Move (x, y): move relative to the current position of the node. MoveDown (): Move the node down. MoveTo (newContainer): Move the node to the new container. MoveToBottom (): Move the node to the bottom of its brother node. MoveToTop (): Move a node to its brother node. MoveUp (): Move up node. Off (typesStr): removes node event binding. Multiple event names are separated by spaces. You can also use namespace to remove event bindings. On (typesStr, handler): Add event binding. Multiple event names are separated by spaces. You can also bind events using namespaces. Remove (): removes a node but does not destroy it. RemoveChildren (): removes all child nodes but does not destroy them. Rotate (theta): allows the node to rotate the specified range. RotateDeg (deg): allows the node to rotate the specified angle. SetAbsolutePosition (x, y): sets the absolute position of a node. SetAttr (attr): set a single attribute of a node. SetAttrs (config): set multiple attributes of a node. SetClearBeforeDraw (clearBeforeDraw): sets whether to clear the previous painting before node re-painting. clearBeforeDraw can be set to true or false. SetClipFunc (deg): sets the cropping function. SetDragBoundFunc (dragBoundFunc): sets the boundfunction. SetDraggable (draggable): sets the node's scalability. SetHeight (height): Set the node height. SetId (id): Set the node id. SetListening (listening): sets the event listening status. SetName (name): Set the node name. SetOffset (x, y): Set the node offset value. SetOffsetX (x): Set the Offset Value of the x axis of the node. SetOffsetY (y): sets the y-axis offset of the node. SetOpacity (opacity): sets the node transparency. SetPosition (x, y): Set the position of the node relative to the parent node. SetRotation (theta): Set the node rotation range. SetRotationDeg (deg): Set the node rotation angle. SetScale (scale): Set the node scale ratio. SetScaleX (x): Set the zooming ratio of the x axis of the node. SetScaleY (y): sets the node's y-axis scaling ratio. SetSize (width, height): Set the node size. SetSkew (x, y): Set node coordinates. SetSkewX (x): sets the horizontal node position. SetSkewY (y): sets the vertical position of a node. SetVisible (visible): sets the node visibility. SetWidth (width): Set the node width. SetX (x): Set the x axis coordinates of the node. SetY (y): Set the y axis of the node. SetZIndex (zIndex): set the level of the node relative to the sibling node. Show (): displays nodes. StartDrag (): Start to drag. StopDrag (): Stop dragging. ToDataURL (config): creates an image data url. {Callback: "callback Function after merging", mimeType: "specifies the type of the merged image. image/png is the default type.", x: "abscissa", y: "ordinate ", width: "width", height: "height", quality: "quality of the synthesized image, 0-1"} toImage (config): merged image. {Callback: "callback Function after merging", mimeType: "specifies the type of the merged image. image/png is the default type.", x: "abscissa", y: "ordinate ", width: "width", height: "height", quality: "quality of the merged image, 0-1"} toJSON (): converts a node to a json string. ToObject (): converts a json string to a json object.

  


  

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.