An icon label style for use in WebGL2 rendering.
Inheritance Hierarchy
WebGL2IconLabelStyle
Remarks
Note that unlike ILabelStyle implementations, this class is immutable and can not be used with setStyle. All properties are read-only and immutable and the class cannot be subclassed, either. Its sole purpose is to be used with the setStyle method of WebGL2GraphModelManager.
Type Details
- yfiles module
- view-webgl
- yfiles-umd modules
- view-webgl, view
- Legacy UMD name
- yfiles.view.WebGL2IconLabelStyle
See Also
Constructors
WebGL2IconLabelStyle
(icon: ImageData, iconColor?: Color, backgroundColor?: Color, backgroundStroke?: WebGL2Stroke, insets?: number, shape?: WebGL2LabelShape, effect?: WebGL2Effect, textureRendering?: WebGL2TextureRendering)Creates a new icon label style that is rendered with WebGL2.
Remarks
This style can be applied to labels that are rendered by the WebGL2GraphModelManager.
The preferred way of calling the constructor is using option arguments, as there are many defaults and optional arguments. To use the default value for a color option, set it to null
.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- icon - ImageData
- The mandatory image data for the icon to be used for the label.
- iconColor - Color
- The fill color of the icon, or
null
. If this parameter isnull
, the original color of the icon is used. Otherwise the alpha values of the icon will be combined with the color values from this value. Defaults tonull
. - backgroundColor - Color
- The color of the label's background. Defaults to TRANSPARENT, which does not render a background.
- backgroundStroke - WebGL2Stroke
- The color of the label's background border. Defaults to NONE, which does not render a stroke.
- insets - number
- The padding of the text within the label's bounds. Defaults to
0
. - shape - WebGL2LabelShape
- The shape of the label's background. Defaults to RECTANGLE.
- effect - WebGL2Effect
- The effect around the label. Defaults to NONE.
- textureRendering - WebGL2TextureRendering
- Rendering hint on how to resolve blurriness of icon images at large zoom levels. Defaults to INTERPOLATED. We recommend not using SDF for images that contain gradients.
Properties
Gets the fill color for the background of the shape.
Gets the color of the stroke around the shape.
Gets the set of applied effects on this style.
Gets the shape of the label's background.
Remarks
Adjust the insets to ensure that rounded shapes still contain the complete text.
Gets the rendering hint on how to resolve blurriness of icon images on large zoom values.
Remarks
Default value is INTERPOLATED. We recommend not using SDF for images that contain gradients.