C

Qt Quick Ultralite layers Example

/****************************************************************************** ** ** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Quick Ultralite module. ** ** $QT_BEGIN_LICENSE:COMM$ ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see http://www.qt.io/terms-conditions. For further ** information use the contact form at http://www.qt.io/contact-us. ** ** $QT_END_LICENSE$ ** ******************************************************************************/
import QtQuick 2.15 import QtQuickUltralite.Layers 1.2 Application { Screen { id: screen width: 800 height: 480 property int boxWidth: screen.width * 43 / 100 property int boxHeight: screen.height * 40 / 100 property int marginWidth: screen.width * 4 / 100 AnimatingItemLayer { id: bpp32layer z: 2 width: screen.boxWidth height: screen.boxHeight anchors.top: parent.top anchors.right: parent.right anchors.margins: screen.marginWidth renderingHints: LayerBase.OptimizeForSize refreshInterval: 4 colorDepth: 32 opacity: 0.6 } SpriteLayer { id: spriteLayer32bpp z: 4 opacity: 0.6 anchors.fill: parent AnimatingItemLayer { z: 2 width: screen.boxWidth height: screen.boxHeight anchors.top: parent.top anchors.left: parent.left anchors.margins: screen.marginWidth colorDepth: 32 refreshInterval: 2 } Repeater { model: 6 MovingImageLayer { z: 1 container: spriteLayer32bpp source: "qt-logo.png" } } } SpriteLayer { id: spriteLayer16bpp z: 0 anchors.fill: parent depth: ItemLayer.Bpp16 ImageLayer { z: 0 source: "background-big.png" } AnimatingItemLayer { z: 1 width: screen.boxWidth height: screen.boxHeight anchors.left: parent.left anchors.bottom: parent.bottom anchors.margins: screen.marginWidth colorDepth: 16 depth: ItemLayer.Bpp16 opacity: 0.6 } } AnimatingItemLayer { depth: ItemLayer.Bpp16Alpha z: 1 width: screen.boxWidth height: screen.boxHeight anchors.right: parent.right anchors.bottom: parent.bottom anchors.margins: screen.marginWidth colorDepth: 16 opacity: 0.6 } } }