DisplayParentType class (RadialMenu)

DisplayParentType()

new DisplayParentType()

The DisplayParentType type defines the type for displayParent field of Options object, which specifies how to display the parent item of the current displayed items. The DisplayParentType type provides a flexible way to control the visual representation of the parent item in the radial menu. It defines where to display the parent item's image and caption, and how to align and size the image relative to the caption. For instance, you can choose to display only the parent item's caption, or to display both the image and the caption with a specific alignment and size. The DisplayParentType type allows you to customize the appearance of the parent item in the radial menu according to your preferences and requirements.

Members

(static) caption :null|number

The caption field defines where the item's caption is placed (as a ratio). The image field defines where the item's image is placed (as a ratio). The imageSize field sets the image's aspect ratio, and imageAlign controls how the image is aligned relative to the caption (applies only to content). The content field defines where the item's content (image and caption together) is placed. If you use content together with image or caption, the image or caption may appear twice - once inside the content and once separately. To avoid this, when using content, set image and caption to null.

The caption field supports the following values:

  • {null} or {undefined}, specifies that no caption is displayed
  • {number}, a number that specifies ratio to determine where the item's caption of items with children is displayed. For instance, 0 specifies that the item's caption is displayed on the outside ring, 0.5 specifies that the item's caption is displayed in the center of the ring, and 1 specifies that the item's caption is displayed on the inside ring. A negative number can be used to specify that the item's caption is displayed outside the ring with a distance from the outside ring equal multipled by radius of the ring. For instance, -0.5 specifies that the item's caption is displayed outside the ring with a distance from the outside ring equal to half of the radius of the ring. A number greater than 1 can be used to specify that the item's caption is displayed inside the ring with a distance from the inside ring equal multipled by radius of the ring
Type:
  • null | number
Example
null {null}, specifies that no caption is displayed
0 {number}, specifies that the item's caption is displayed on the outside ring
0.5 {number}, specifies that the item's caption is displayed in the center of the ring
caption

(static) content :null|number

The content field defines where the item's content (caption and image together) is placed (as a ratio). The image field defines where the item's image is placed (as a ratio). The caption field defines where the item's caption is placed (as a ratio). The imageSize field sets the image's aspect ratio, and imageAlign controls how the image is aligned relative to the caption (applies only to content). If you use content together with image or caption, the image or caption may appear twice - once inside the content and once separately. To avoid this, when using content, set image and caption to null.

The content field supports the following values:

  • {null} or {undefined}, specifies that no content (caption and image together) is displayed
  • {number}, a number that specifies ratio to determine where the item's content (caption and image together) of items with children is displayed. For instance, 0 specifies that the item's content (caption and image together) is displayed on the outside ring, 0.5 specifies that the item's content (caption and image together) is displayed in the center of the ring, and 1 specifies that the item's content (caption and image together) is displayed on the inside ring. A negative number can be used to specify that the item's content (caption and image together) is displayed outside the ring with a distance from the outside ring equal multipled by radius of the ring. For instance, -0.5 specifies that the item's content (caption and image together) is displayed outside the ring with a distance from the outside ring equal to half of the radius of the ring. A number greater than 1 can be used to specify that the item's content (caption and image together) is displayed inside the ring with a distance from the inside ring equal multipled by radius of the ring
Type:
  • null | number
Example
null {null}, specifies that no content is displayed
0 {number}, specifies that the item's content (caption and image together) is displayed on the outside ring
0.5 {number}, specifies that the item's content (caption and image together) is displayed in the center of the ring
content

(static) image :null|number

The image field defines where the item's image is placed (as a ratio). The DisplayParentType.imageSize field sets the image's aspect ratio, and imageAlign controls how the image is aligned relative to the caption (applies only to content). The content field defines where the item's content (image and caption together) is placed. If you use content together with image or caption, the image or caption may appear twice - once inside the content and once separately. To avoid this, when using content, set image and caption to null.

The image field supports the following values:

  • {null} or {undefined}, specifies that no image is displayed
  • {number}, a number that specifies ratio to determine where the item's image of items with children is displayed. For instance, 0 specifies that the item's image is displayed on the outside ring, 0.5 specifies that the item's image is displayed in the center of the ring, and 1 specifies that the item's image is displayed on the inside ring. A negative number can be used to specify that the item's image is displayed outside the ring with a distance from the outside ring equal multipled by radius of the ring. For instance, -0.5 specifies that the item's image is displayed outside the ring with a distance from the outside ring equal to half of the radius of the ring. A number greater than 1 can be used to specify that the item's image is displayed inside the ring with a distance from the inside ring equal multipled by radius of the ring
Type:
  • null | number
Example
null {null}, specifies that no image is displayed
0 {number}, specifies that the item's image is displayed on the outside ring
0.5 {number}, specifies that the item's image is displayed in the center of the ring
image

(static) imageAlign :number

The imageAlign field specifies the alignment of the item's image relative to the item's caption. The imageAlign field is valid only if content field is specified. In other words, imageAlign field aligns the item's caption and image when they are both displayed by content field. The imageSize field specifies the aspect ratio to display the item's image.

The imageAlign field supports the following values:

  • 0 {number}, the image is left-aligned
  • 1 {number}, the image is right-aligned
  • 2 {number}, the image is top-aligned
  • 3 {number}, the image is bottom-aligned
Type:
  • number
Example
0 {number}, the image is left-aligned
2 {number}, the image is top-aligned
imageAlign

(static) imageSize :null|number|array

The imageSize field defines the size of the item's image. The imageSize field has effect only if the image field is set to a number (which specifies that an image is displayed). The imageAlign field specifies the alignment of the item's image relative to the item's caption.

The imageSize field supports the following values:

  • {null}, Indicates that the item's image is displayed as it is (full-sized).
  • {number}, Specifies that the item's image is displayed into a square of giving size (same width and height). If 0 the item displays no image, if negative the item's image is stretched to giving square, else the item's picture is scaled to fit the giving rectangle.
  • {array}, Specifies an array of [aspect-width,aspect-height] type that defines the limits for width or/and height. The aspect-width and aspect-height define the width/height of the item's picture to scale or stretch to. For instance, [32,64] scales the image to the largest ratio-rectangle (32 x 64) that fits the client, and [-32,-64] stretches the image to a 32 x 64 rectangle.
Type:
  • null | number | array
Example
null {null}, indicates that the item's image is displayed as it is (full-sized)
0 {number}, no image is displayed
64 {number}, the image is scaled to fit a 64 x 64 rectangle
-64 {number}, the image is strected to a 64 x 64 rectangle
[32,64] {array}, scales the image to the largest ratio-rectangle (32 x 64) that fits the client
[-32,-64] {array}, stretches the image to a 32 x 64 rectangle
imageSize

(static) visible :number

The visible field defines whether the caption or/and image of the item are being shown. Indicates one of the following:
  • 0 {number}, no caption or image is shown
  • 1 {number}, the item's caption is included
  • 2 {number}, the item's image is included
  • 3=1|2 {number}, indicates that caption and image of the item are both shown
  • 16 {number}, indicates that only item's image or item's caption is displayed (by default) (@since 2.2)
Type:
  • number
Example
0 {number}, displays no caption or image
3 {number}, displays the item's caption and image
visible