debut explication

This commit is contained in:
mpelissi 2023-03-06 18:01:12 +01:00
parent f89d8b180c
commit 58fb282be5
2 changed files with 31 additions and 7 deletions

View File

@ -1,15 +1,38 @@
function init_explication(){
alpha_ecran = 0.9
alpha_clignotement = 0.8
color_ecran ="rgb(255,255,255)"
color_texte = "rgb(0,0,0)"
color_clignotement = "rgb(255,0,255)"
font_texte = "28pt Courier"
l_texte_max = 600
actions = [
{'ecran': {'x':W_3D +50, "y": 200, "w":window.innerWidth-W_3D-80, "h":400, "c":color_ecran,"a": alpha_ecran},
"texte": {"t":"Voici comment se présente l'interface.", "x":W_3D + 80, "y":300, "f":font_texte, "l":l_texte_max, "c":color_texte},
'clignotement': {"x":0, "y":0, "w":100, "h":100, "c":color_clignotement,"a": alpha_clignotement}}
]
num_action = 0
}
function traitement_explications(){
//ctx.clearRect(0, 0, canvas.width, canvas.height)
ctx.strokeStyle = "rgb(255, 255, 255)" // Pour que le contour soit rouge
ctx.fillStyle = "rgb(255, 255, 255)" // Pour que l'intérieur soit bleu
texte = "Explications"
font = "42pt Courier"
ctx.font = font
largeur = ctx.measureText(texte).width
ctx.fillText(texte, (window.innerWidth/2)- (largeur/2), 100)
//texte = "Explications"
//font = "42pt Courier"
//ctx.font = font
//largeur = ctx.measureText(texte).width
//ctx.fillText(texte, (window.innerWidth/2)- (largeur/2), 100)
// clignotement
afficher_ecran(0,0,400,600,"rgb(255,255,255)", 1)
// STEP 1
action = actions[num_action]
afficher_ecran(action.ecran.x, action.ecran.y, action.ecran.w, action.h, action.c, action.a )
print_text(handle_text(action.texte.t, action.texte.x, action.texte.y, action.texte.f, action.texte.l, action.texte.c))
}

View File

@ -415,6 +415,7 @@ function animate() {
if(premier_tour_page_explications){
// init clavier pour les vues
//init_clavier_vues()
init_explication()
// affichage ecran 3D de manière aléatoire
setUp_3D(indice_mesh, 2, 2)
premier_tour_page_explications = false