SpriteLayer QML Type

A sprite layer which can contain multiple image and item layers. 更多...

导入语句: import QtQuickUltralite.Layers .
Since: Qt Quick Ultralite 1.7
继承:

Item

特性

详细描述

A sprite layer can contain multiple image and item layers, which are then called sprites or sub-layers.

Most hardware platforms limit the no. of root layers that an application can have. You can overcome this by using sprite layers that contain a number of smaller layers to save memory. Although the sprite layers are useful, they do come with the following limitations:

  • There's a limited number of sub-layers per sprite layer, typically eight or less
  • Opacity will be ignored for the sub-layers.
  • Overlapping sub-layers are not blended together, showing only the pixel from the top-most sub-layer.
  • On the Renesas RH850 platform:
    • Color depth of the sprite must be compatible with the hardware layer.
    • The X position of a sprite is rounded to a multiple of two pixels for layers with 32 bit color depth, and four pixels for layers with 16 bit color depth.

用法范例:

SpriteLayer {
    x: 10
    y: 60
    width: 100
    height: 100
    ImageLayer {
        y: 20
        source: "qrc:/images/splash.png"
    }
    ItemLayer {
        y: 40
        width: 100
        height: 60
        Text {
            text: "Hello World"
            anchors.centerIn: parent
        }
    }
}
						

注意: This type is specific to Qt Quick Ultralite. See also the compatibility 页面。

另请参阅 应用程序 , Screen , ImageLayer , ItemLayer ,和 使用硬件层改善性能 .

特性文档编制

The preferred color depth to use for the layer.

可能的值:

常量 描述
SpriteLayer.Bpp16 16 bits per pixel color depth, no alpha channel
SpriteLayer.Bpp16Alpha 16 bits per pixel color depth, with alpha channel
SpriteLayer.Bpp24 24 bits per pixel color depth, no alpha channel
SpriteLayer.Bpp32 32 bits per pixel color depth, no alpha channel
SpriteLayer.Bpp32Alpha 32 bits per pixel color depth, with alpha channel (default)

platformId : int

A unique value to identify the layer to the platform.

For use with platform specific API to set custom layer properties.