Advertisement
Guest User

Untitled

a guest
Jan 17th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. PFont ff13; // déclaration police
  2.  
  3. PImage P1; // déclaration Image en haut à droite
  4. PImage P2; // déclaration Image en haut à gauche
  5. PImage BG; // déclaration Background
  6.  
  7. // Déclarations des positions d'images + textes
  8. int decalageP1ImagePVX;
  9. int decalageP1NomX;
  10. float decalageP2ImageX;
  11. float decalageP2PVX;
  12. float decalageP2NomX;
  13. float pvY;
  14. float NomY;
  15. float ImagesY;
  16. float PPx;
  17. float PPy;
  18.  
  19. int Chapitre = 1; //<--- incrémenté à chaque fin de scène (autre code)
  20.  
  21. String ChapScene1 = "L'arrivée dans la forêt"; //<--- Proviendra d'un autre code
  22.  
  23. int pv1 = 100; //P1<--- proviendra de la fiche perso
  24.  
  25. int pv2 = 100; //P2<--- proviendra de la fiche perso
  26.  
  27. void setup() {
  28.  
  29. //size(1280,720);
  30. background(0);
  31. fullScreen();
  32.  
  33. //Chargement police
  34.  
  35. ff13 = loadFont("Square721BT-Roman-200.vlw");
  36.  
  37. //Déclaration variables de positions
  38.  
  39. decalageP1ImagePVX = width-(width/17);
  40. decalageP1NomX = width-(width/20);
  41.  
  42. decalageP2PVX = width-(width/1.022);
  43. decalageP2ImageX = width-(width/1.026);
  44. decalageP2NomX = width-(width/1.025);
  45.  
  46. pvY = height-(height/1.13);
  47. NomY = height-(height/1.16);
  48. ImagesY = height-(height/1.03);
  49.  
  50. PPx = width-(width/1.04);
  51. PPy = height-(height/1.07);
  52.  
  53. //Chargement images
  54.  
  55. BG = loadImage("data/DarkSpace.png"); //BACKGROUND
  56.  
  57. P1 = loadImage("data/Swordsman.png"); //avatar P1
  58.  
  59. P2 = loadImage("data/Mage.png"); //avatar P2
  60. }
  61.  
  62. void draw() {
  63.  
  64. image(BG, 0, 0, width, height);
  65. image(P1, decalageP1ImagePVX, ImagesY, PPx, PPy); //ImageP1
  66. image(P2, decalageP2ImageX, ImagesY, PPx, PPy); //ImageP2
  67.  
  68. textFont(ff13, width/95); //Utilisation de la police
  69.  
  70. text("Jörg", decalageP1NomX, NomY); //P1
  71. text("PV : "+pv1, decalageP1ImagePVX, pvY); //P1
  72.  
  73. text("Kolgrim", decalageP2NomX, NomY); //P2
  74. text("PV : "+pv2, decalageP2PVX, pvY); //P2
  75.  
  76. pushMatrix();
  77. textSize(width/50);
  78. text("Chapitre "+Chapitre+": "+ChapScene1, width/3, height/14, (width/3) * 2, (height/14)*3 );
  79. popMatrix();
  80.  
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement