Skip to main content

Texture Reference

Texture references are similar to Asset References, the difference is that a texture reference can optionally accept a sample mode operator.

As with Asset References, omitting the module name will resolve the texture against the current style file's module.

Sample modes define how the engine should treat the texture.

  • NineSlice Apply border slicing to the image
  • LinearGradient sample as linear gradient
  • RadialGradient sample as radial gradient
  • EllipticalGradient sample as an elliptical gradient
  • ConicGradient sample as a conic gradient
  • SoftMask use this texture as a soft mask that handle partially transparent masking
  • HardMask use this texture as hard mask where any pixel value less than 1f will mask away that value
  • SoftMaskInverse same as SoftMask but applies an invert operation before rendering
  • HardMaskInverse same as HardMask but applies an invert operation before rendering

Examples

style sample-textures {
BackgroundImage = linear-gradient("gradientName");
BackgroundImage = linear-gradient("moduleName::gradientName");
BackgroundImage = radial-gradient("moduleName::gradientName");
BackgroundImage = ellipitcal-gradient("moduleName::gradientName");
BackgroundImage = conic-gradient("moduleName::gradientName");
BackgroundImage = soft-mask("moduleName::maskName");
BackgroundImage = soft-mask-inverse("moduleName::maskName");
BackgroundImage = hard-mask("maskName");
BackgroundImage = hard-mask-inverse("maskName");
BackgroundImage = nine-slice("moduleName::textureName");
BackgroundImage = "moduleName::textureName";
BackgroundImage = "textureName";
}