Commit 1b409e19 authored by Johnny Jazeix's avatar Johnny Jazeix
Browse files

letter-in-word, make the coloration work on android, update activity version

parent 4c896a05
......@@ -31,5 +31,5 @@ ActivityInfo {
manual: ""
credit: ""
section: "reading"
createdInVersion: 6000
createdInVersion: 7000
}
......@@ -54,8 +54,9 @@ Item {
GCText {
id: textItem
z: 11
// textData is the rich text with letter found, spelling is the text in the dataset
text: selected ? textData : spelling
// textFound is the rich text with letter found, spelling is the text in the dataset
text:"<font color=\"white\">" + (selected ? textFound : spelling) + "</font>"
property string textFound: spelling
textFormat: Text.RichText
font.pointSize: NaN // need to clear font.pointSize explicitly
font.pixelSize: spelling.length > 5 ? (spelling.length > 7 ? cardImage.width * 0.19 : cardImage.width * 0.25): cardImage.width * 0.30
......@@ -67,7 +68,6 @@ Item {
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
styleColor: "#2a2a2a"
color: "white"
}
ParticleSystemStarLoader {
......@@ -92,7 +92,7 @@ Item {
SequentialAnimation {
id: successAnimation
running: selected
loops: Animation.Infinite
loops: 2
NumberAnimation {
target: cardImage
easing.type: Easing.InOutQuad
......@@ -105,6 +105,11 @@ Item {
property: "rotation"; to: -20
duration: 500
}
onRunningChanged: {
if(!running && selected) {
rotationStop.restart()
}
}
}
SequentialAnimation {
......@@ -156,7 +161,7 @@ Item {
if (Activity.checkWord(index)) {
successAnimation.restart();
particle.burst(30);
textData = spelling.replace(RegExp(Activity.currentLetter, "g"), "<font color=\"green\">"+Activity.currentLetter+"</font>");
textItem.textFound = spelling.replace(RegExp(Activity.currentLetter, "g"), "<font color=\"#00FF00\">"+Activity.currentLetter+"</font>");
}
else {
failureAnimation.restart()
......
......@@ -225,7 +225,7 @@ ActivityBase {
id: animateX
target: planeText
properties: "x"
from: - planeText.width
from: -planeText.width
//to:background.width/2 - planeText.width/2
to: bar.level <= 2 ? background.width/3.7 : background.width
duration: bar.level <= 2 ? 5500: 11000
......@@ -269,7 +269,7 @@ ActivityBase {
id: wordsModel
}
property int itemWidth: Math.min(parent.width / 7.5, parent.height / 5)
property int itemWidth: Math.min(parent.width / 7.5, parent.height / 6.5)
property int itemHeight: itemWidth * 1.11
GridView {
......@@ -282,7 +282,7 @@ ActivityBase {
anchors.leftMargin: 15 * ApplicationInfo.ratio
anchors.rightMargin: 15 * ApplicationInfo.ratio
anchors.bottomMargin: 10 * ApplicationInfo.ratio
cellWidth: itemWidth + 43*ApplicationInfo.ratio
cellWidth: itemWidth + 25*ApplicationInfo.ratio
cellHeight: itemHeight + 15*ApplicationInfo.ratio
clip: false
interactive: false
......
......@@ -126,8 +126,7 @@ function initLevel() {
items.wordsModel.append({
"spelling": words[i].translatedTxt,
"imgurl": words[i].image,
"selected": false,
"textData": words[i].translatedTxt
"selected": false
});
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment