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(){ function traitement_explications(){
//ctx.clearRect(0, 0, canvas.width, canvas.height) //ctx.clearRect(0, 0, canvas.width, canvas.height)
ctx.strokeStyle = "rgb(255, 255, 255)" // Pour que le contour soit rouge 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 ctx.fillStyle = "rgb(255, 255, 255)" // Pour que l'intérieur soit bleu
texte = "Explications" //texte = "Explications"
font = "42pt Courier" //font = "42pt Courier"
ctx.font = font //ctx.font = font
largeur = ctx.measureText(texte).width //largeur = ctx.measureText(texte).width
ctx.fillText(texte, (window.innerWidth/2)- (largeur/2), 100) //ctx.fillText(texte, (window.innerWidth/2)- (largeur/2), 100)
// 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))
// clignotement
afficher_ecran(0,0,400,600,"rgb(255,255,255)", 1)
} }

View File

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