From 58fb282be5941d5793df3a61ea49927fa8d00ebb Mon Sep 17 00:00:00 2001 From: mpelissi Date: Mon, 6 Mar 2023 18:01:12 +0100 Subject: [PATCH] debut explication --- static/fonctions_explications.js | 37 ++++++++++++++++++++++++++------ static/interface3D.js | 1 + 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/static/fonctions_explications.js b/static/fonctions_explications.js index d259139..b1961f5 100644 --- a/static/fonctions_explications.js +++ b/static/fonctions_explications.js @@ -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)) + + } diff --git a/static/interface3D.js b/static/interface3D.js index c8113d8..72d3760 100644 --- a/static/interface3D.js +++ b/static/interface3D.js @@ -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