2 |
2 |
3 function IncChoice() |
3 function IncChoice() |
4 { |
4 { |
5 this.currentWorldIndex = 0; |
5 this.currentWorldIndex = 0; |
6 this.canSelectWord = true; |
6 this.canSelectWord = true; |
|
7 this.image1; |
|
8 this.image2; |
|
9 this.image3; |
7 |
10 |
8 this.setMosaicEffect = function(images1, images2) |
11 this.setMosaicImages = function(images1, images2, images3) |
9 { |
12 { |
10 // Choose 2 image for the effect |
13 // Choose 2 image for the effect |
11 var image1 = images1[incMosaic.randomInt(0, images1.length)]; |
14 this.image1 = images1[incMosaic.randomInt(0, images1.length)]; |
12 var image2 = images2[incMosaic.randomInt(0, images2.length)]; |
15 this.image2 = images2[incMosaic.randomInt(0, images2.length)]; |
13 incMosaic.addImageUrl("static/res/img/" + image1); |
16 this.image3 = images3[incMosaic.randomInt(0, images3.length)]; |
14 incMosaic.addImageUrl("static/res/img/" + image2); |
|
15 |
17 |
16 // Start mosaic effect |
18 incMosaic.addImageUrl("static/res/img/" + this.image1); |
17 incMosaic.start("mosaic", effectSpeed, 9, 5, false, true, function() {incChoice.effectIsDone();}); |
19 incMosaic.addImageUrl("static/res/img/" + this.image2); |
|
20 incMosaic.addImageUrl("static/res/img/" + this.image3); |
|
21 |
|
22 incMosaic.start("mosaic", effectSpeed, 9, 5, true, true, function() {incChoice.effectIsDone();}); |
18 }; |
23 }; |
19 |
24 |
20 this.setWords = function(choiceIndex) |
25 this.setWordsAndEffect = function(choiceIndex) |
21 { |
26 { |
22 if (choiceIndex == 0) { |
27 if (choiceIndex == 0) { |
23 $("#mot1").html("famille"); |
28 $("#mot1").html("famille"); |
24 $("#mot2").html("amour"); |
29 $("#mot2").html("amour"); |
25 $("#mot3").html("travail"); |
30 $("#mot3").html("travail"); |
26 $("#mot4").html("international"); |
31 $("#mot4").html("international"); |
27 $("#mot5").html("dieu"); |
32 $("#mot5").html("dieu"); |
28 $("#mot6").html("president"); |
33 $("#mot6").html("president"); |
29 |
34 |
|
35 // Set images for effect |
|
36 //incMosaic.clear(); |
|
37 //incMosaic.addImageUrl("static/res/img/" + this.image1); |
|
38 //incMosaic.addImageUrl("static/res/img/" + this.image2); |
|
39 |
30 } else if (choiceIndex == 1) { |
40 } else if (choiceIndex == 1) { |
31 $("#mot1").html("actif"); |
41 $("#mot1").html("actif"); |
32 $("#mot2").html("passif"); |
42 $("#mot2").html("passif"); |
33 $("#mot3").html("corps"); |
43 $("#mot3").html("corps"); |
34 $("#mot4").html("charité"); |
44 $("#mot4").html("charite"); |
35 $("#mot5").html("patrie"); |
45 $("#mot5").html("patrie"); |
36 $("#mot6").html("politique"); |
46 $("#mot6").html("politique"); |
|
47 |
|
48 // Set images for effect |
|
49 //incMosaic.clear(); |
|
50 //incMosaic.addImageUrl("static/res/img/" + this.image2); |
|
51 //incMosaic.addImageUrl("static/res/img/" + this.image3); |
37 |
52 |
38 } else { |
53 } else { |
39 $("#mot1").html("spleen"); |
54 $("#mot1").html("spleen"); |
40 $("#mot2").html("ideal"); |
55 $("#mot2").html("ideal"); |
41 $("#mot3").html("origines"); |
56 $("#mot3").html("origines"); |
42 $("#mot4").html("peur"); |
57 $("#mot4").html("peur"); |
43 $("#mot5").html("desir"); |
58 $("#mot5").html("desir"); |
44 $("#mot6").html("bonheur"); |
59 $("#mot6").html("bonheur"); |
|
60 |
|
61 // Set images for effect |
|
62 //incMosaic.clear(); |
|
63 //incMosaic.addImageUrl("static/res/img/" + this.image3); |
|
64 //incMosaic.addImageUrl("static/res/img/" + this.image1); |
45 } |
65 } |
|
66 |
|
67 //incMosaic.start("mosaic", effectSpeed, 9, 5, false, true, function() {incChoice.effectIsDone();}); |
46 }; |
68 }; |
47 |
69 |
48 this.selectWord = function(wordIndex) |
70 this.selectWord = function(wordIndex) |
49 { |
71 { |
50 if (!this.canSelectWord) { |
72 if (!this.canSelectWord) { |