Developers Manual > Cocos Studio > UI Editor > UI Widget > UI Widget UIDragPanel

UI Widget UIDragPanel

Icon

Description

The UIDragPanel subclass implements the drag layer of the touch screen. The UIDragPanel subclass is a subclass of UIWidget.
The control provides methods to set the layer container’s clip, width and height, background color opacity, fill color, picture resources and other attributes.

Squared Properties

For more information, see UI controls common attributes.

General Properties

For more information, see UI controls common attributes.

Feature

Clip

Hides control’s child controls, which are located out of the display area.

File

Sets a picture (png, jpg) that will be displayed on default status.

DisplayAreaWidth

Sets the width of the display area.

DisplayAreaHeight

Sets the height of the display area.

ScrollAreaWidth

Sets the width of the scroll area.

ScrollAreaHeight

Sets the height of the scroll area.

Note : A green wireframe displays after setting the scroll zone width and height. Child controls that need to be scrolled must be located within the green wireframe.

BackgroundColorOpacity

Sets the opacity of the background color,ranging from 0-255, 0 for transparent, 255 for the opaque option.

FillColor

No color

No background color on this status.

Monochrome

Sets the background color(RGB).

GradientColor

  1. StartColor Sets the starting color of the gradient.
  2. EndColor Sets the ending color of the gradient.
  3. X X Vector
  4. Y Y Vector

h2 AdvancedProperties

InertiaLastTime

The duration that the layer continues moving on when the dragging layer is stopped.

InertiaInchingFrequery

The frequency to change moving speed when stopping the dragging layer. The default is set to 2. When the value is greater than 1, the drag of the layer’s movement is slower and the higher the value, the more obvious the slowing effect. When the value is less than 1, the drag of the layer’s movement is faster and with a smaller value, the less obvious the acceleration effect.

OpenResilience

Set whether to open a resilience effect. If open, when the layer’s contents are dragged, the contents can be dragged outside of the boundary layer. After the finger’s release, the control will rebound to inside the layer boundary.

Duration

The duration of moving the drag layer to the drag layer boundary when stopping the drag and the drag layer must be located near the boundary.

SlowFrequency

The frequency to change the moving speed when stopping the dragging layer and the drag layer is near the boundary. The default is set to 2. When the value is greater than 1, the drag of the layer’s coasting is slower. The higher the value, the more obvious the slowing effect. When the value is less than 1, the drag the layer coasting is faster and with a smaller value, the less obvious the acceleration effect.

3-3-15-img-01.png (6.2 kB) hanrea@qq.com, 2013-12-03 08:06

3-3-15-img-02.png (14.8 kB) hanrea@qq.com, 2013-12-03 08:06

3-3-15-img-03.png (8.9 kB) hanrea@qq.com, 2013-12-03 08:06

Sign up for our newsletter to keep up with the latest developments, releases and updates for Cocos2d-x.