Warning, /education/gcompris/src/activities/babymatch/TextItem.qml is written in an unsupported language. File is not indexed.

0001 /* GCompris - TextItem.qml
0002  *
0003  * SPDX-FileCopyrightText: 2015 Pulkit Gupta <pulkitgenius@gmail.com>
0004  *
0005  * Authors:
0006  *   Pulkit Gupta <pulkitgenius@gmail.com>
0007  *
0008  *   SPDX-License-Identifier: GPL-3.0-or-later
0009  */
0010 import QtQuick 2.12
0011 import GCompris 1.0
0012 import "../../core"
0013 
0014 Item {
0015     id: displayText
0016 
0017     property double posX
0018     property double posY
0019     property double textWidth
0020     property double textHeight
0021     property string showText
0022 
0023     x: posX * parent.width
0024     y: posY * parent.height
0025     width: 1
0026     height: 1
0027 
0028     GCText {
0029         id: displayTxt
0030         anchors {
0031             horizontalCenter: displayText.horizontalCenter
0032             verticalCenter: displayText.verticalCenter
0033         }
0034         fontSizeMode: Text.Fit
0035         minimumPointSize: 7
0036         fontSize: mediumSize
0037         color: "white"
0038         horizontalAlignment: Text.AlignHCenter
0039         verticalAlignment: Text.AlignVCenter
0040         width: textWidth * displayText.parent.width
0041         height: textHeight * displayText.parent.height
0042         wrapMode: TextEdit.WordWrap
0043         z: 2
0044         text: showText
0045     }
0046 
0047     Rectangle {
0048         id: displayTxtContainer
0049         anchors {
0050             horizontalCenter: displayText.horizontalCenter
0051             verticalCenter: displayText.verticalCenter
0052         }
0053         width: displayTxt.width + 10
0054         height: displayTxt.height + 10
0055         z: 1
0056         radius: 10
0057         color: "#373737"
0058     }
0059 }