AGSScriptModuleKitaiGestion plus aisée des Raws (à défaut des Overlays)Graphic motor1.1µ // Main script for module 'Graphic motor' struct Image { //le type de variable qui sert à référencer une couche float x; float y; float z; float t; int c; float vx; float vy; float vz; float vt; int spr; bool a; }; Image img[20]; //le tableau qui contient 20 couches, possibilité de modifier bool ENTERED; //la variable booléenne qui déclenche l'affichage des couches function Affimg(int spr, int lay, int x, int y, int z, int t) { //la fonction qui crée une couche qui contient la sprite dans les réglages voulue img[lay].x = IntToFloat(x); img[lay].y = IntToFloat(y); img[lay].z = IntToFloat(z); img[lay].t = IntToFloat(t); img[lay].spr = spr; img[lay].a = true; } function Depimg(int lay, int x, int y, int c, int z, int t) { //la fonction qui permet de déplacer et modifier visiblement les réglages de l'image float cy = IntToFloat(c); img[lay].vx = (IntToFloat(x) - img[lay].x) / cy; img[lay].vy = (IntToFloat(y) - img[lay].y) / cy; if (t != 101) img[lay].vt = (IntToFloat(t) - img[lay].t) / cy; if (z != 0) img[lay].vz = (IntToFloat(z) - img[lay].z) / cy; img[lay].c = c; } function Supimg(int lay) { //la fonction qui libère une couche, pour que la sprite attribuée ne soit plus affichée à l'écran img[lay].a = false; } #sectionstart on_event function on_event(EventType event, int data) { //la fonction qui permet d'amorcer l'affichage, après avoir sauvegardé le fond pour pouvoir le rappeler plus tard if (event == eEventEnterRoomBeforeFadein) { RawSaveScreen(); ENTERED = true; } } #sectionend on_event #sectionstart repeatedly_execute_always function repeatedly_execute_always() { //la fonction qui s'éxécute en boucle et affiche les sprites des différentes couches if (ENTERED) { int b = 0; RawRestoreScreen(); while (b < 20) { if (img[b].a) { if (img[b].c != 0) { img[b].x += img[b].vx; img[b].y += img[b].vy; img[b].z += img[b].vz; img[b].t += img[b].vt; if ((img[b].t > 99.0) && (img[b].t < 101.0)) img[b].t = 0.0; img[b].c -= 1; } DynamicSprite* sprite = DynamicSprite.CreateFromExistingSprite(img[b].spr); sprite.Resize(sprite.Width * FloatToInt(img[b].z) / 100,sprite.Height * FloatToInt(img[b].z) / 100); int x = FloatToInt(img[b].x) - sprite.Width / 2; //AFFICHER DU CENTRE int y = FloatToInt(img[b].y) - sprite.Height / 2; //AFFICHER DU CENTRE RawDrawImageTransparent(x,y,sprite.Graphic,FloatToInt(img[b].t)); //AFFICHER DU CENTRE //RawDrawImageTransparent(FloatToInt(img[b].x),FloatToInt(img[b].y),sprite.Graphic,FloatToInt(img[b].t)); //AFFICHER DU BORD sprite.Delete(); } b++; } } } #sectionend repeatedly_execute_always export ENTERED; //afin de désactiver le "moteur" en cas de perturbations avec d'autres scripts, on rend la variable globaler// Script header for module 'Graphic motor' import function Affimg(int spr, int lay, int x, int y, int z = 100, int t = 99); import function Depimg(int lay, int x, int y, int c, int z = 0, int t = 101); import function Supimg(int lay); import function on_event(EventType event, int data); import function repeatedly_execute_always(); import bool ENTERED;LuÏHej÷´