Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PFont ff13; // déclaration police
- PImage P1; // déclaration Image en haut à droite
- PImage P2; // déclaration Image en haut à gauche
- PImage BG; // déclaration Background
- // Déclarations des positions d'images + textes
- int decalageP1ImagePVX;
- int decalageP1NomX;
- float decalageP2ImageX;
- float decalageP2PVX;
- float decalageP2NomX;
- float pvY;
- float NomY;
- float ImagesY;
- float PPx;
- float PPy;
- int Chapitre = 1; //<--- incrémenté à chaque fin de scène (autre code)
- String ChapScene1 = "L'arrivée dans la forêt"; //<--- Proviendra d'un autre code
- int pv1 = 100; //P1<--- proviendra de la fiche perso
- int pv2 = 100; //P2<--- proviendra de la fiche perso
- void setup() {
- //size(1280,720);
- background(0);
- fullScreen();
- //Chargement police
- ff13 = loadFont("Square721BT-Roman-200.vlw");
- //Déclaration variables de positions
- decalageP1ImagePVX = width-(width/17);
- decalageP1NomX = width-(width/20);
- decalageP2PVX = width-(width/1.022);
- decalageP2ImageX = width-(width/1.026);
- decalageP2NomX = width-(width/1.025);
- pvY = height-(height/1.13);
- NomY = height-(height/1.16);
- ImagesY = height-(height/1.03);
- PPx = width-(width/1.04);
- PPy = height-(height/1.07);
- //Chargement images
- BG = loadImage("data/DarkSpace.png"); //BACKGROUND
- P1 = loadImage("data/Swordsman.png"); //avatar P1
- P2 = loadImage("data/Mage.png"); //avatar P2
- }
- void draw() {
- image(BG, 0, 0, width, height);
- image(P1, decalageP1ImagePVX, ImagesY, PPx, PPy); //ImageP1
- image(P2, decalageP2ImageX, ImagesY, PPx, PPy); //ImageP2
- textFont(ff13, width/95); //Utilisation de la police
- text("Jörg", decalageP1NomX, NomY); //P1
- text("PV : "+pv1, decalageP1ImagePVX, pvY); //P1
- text("Kolgrim", decalageP2NomX, NomY); //P2
- text("PV : "+pv2, decalageP2PVX, pvY); //P2
- pushMatrix();
- textSize(width/50);
- text("Chapitre "+Chapitre+": "+ChapScene1, width/3, height/14, (width/3) * 2, (height/14)*3 );
- popMatrix();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement