A sprite layer which can contain multiple image and item layers. 更多...
导入语句: | import QtQuickUltralite.Layers . |
Since: | Qt Quick Ultralite 1.7 |
继承: |
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:
用法范例:
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 ,和 使用硬件层改善性能 .
depth : enumeration |
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.