C
SpriteLayer QML Type
A sprite layer which can contain multiple image and item layers. More...
Import Statement: | import QtQuickUltralite.Layers |
Since: | Qt Quick Ultralite 1.7 |
Inherits: |
Properties
- depth : enumeration
- platformId : int
Detailed Description
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 items have to be contained inside a Screen item.
Example usage:
Application { Screen { 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 } } } } }
Note: This feature may not be supported by hardware on all reference boards. For more information, see Supported Features table.
Note: This type is specific to Qt Quick Ultralite. See also the compatibility page.
See also Application, Screen, ImageLayer, ItemLayer, and Improving performance using hardware layers.
Property Documentation
depth : enumeration |
The preferred color depth to use for the layer.
Possible values:
Constant | Description |
---|---|
SpriteLayer.Bpp8 | 8 bits per pixel color depth, without alpha channel |
SpriteLayer.Bpp16 | 16 bits per pixel color depth, without alpha channel |
SpriteLayer.Bpp16Alpha | 16 bits per pixel color depth, with alpha channel |
SpriteLayer.Bpp24 | 24 bits per pixel color depth, without alpha channel |
SpriteLayer.Bpp32 | 32 bits per pixel color depth, without 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.
Available under certain Qt licenses.
Find out more.