J'ai fait ce code pour faciliter le placement d'un image dans RM. Il permet de déplacer soit l'image, soit la caméra (en maintenant echap) et permet une fois l'image placée au bon endroit de générer une commande pour afficher l'image au bon endroit.
On peut aussi maintenir shift pour ralentir le déplacement de l'image pour faire au pixel près.
Voici le code :
Event - EV001
On peut aussi maintenir shift pour ralentir le déplacement de l'image pour faire au pixel près.
Voici le code :
Event - EV001
| > Appeler Script : SV[0] = player_pixel_x |
| > Appeler Script : SV[1] = player_pixel_y |
| > Appeler Script : SV[2] = player_x |
| > Appeler Script : SV[3] = player_y |
| > Appeler Script : picture_show(1, 'nom_de_limage', SV[0], SV[1]) |
| > Appeler Script : picture_pin(1) |
| > Appeler Script : camera_move_on(SV[2], SV[3]) |
| > Commentaire : Création de la fonction de mise en forme |
| > Commentaire : Création de la fonction de mise en forme |
| > Appeler Script : SV[4] = picture_x(1) |
| > Appeler Script : SV[5] = picture_y(1) |
| > Boucle |
| >| > Commentaire : Récupération des x et y de l'image pointée |
| >| > Condition : la touche Bas est pressée |
| >| >| > Condition : la touche B est pressée |
| >| >| >| > Appeler Script : SV[3] += 1 |
| >| >| >| > Attendre : 15 Frames |
| >| >| >| > |
| >| >| > Sinon |
| >| >| >| > Appeler Script : SV[5] += 1 |
| >| >| >| > |
| >| >| > Fin - Condition |
| >| >| > |
| >| > Fin - Condition |
| >| > Condition : la touche Haut est pressée |
| >| >| > Condition : la touche B est pressée |
| >| >| >| > Appeler Script : SV[3] -= 1 |
| >| >| >| > Attendre : 15 Frames |
| >| >| >| > |
| >| >| > Sinon |
| >| >| >| > Appeler Script : SV[5] -= 1 |
| >| >| >| > |
| >| >| > Fin - Condition |
| >| >| > |
| >| > Fin - Condition |
| >| > Condition : la touche Gauche est pressée |
| >| >| > Condition : la touche B est pressée |
| >| >| >| > Appeler Script : SV[2] -= 1 |
| >| >| >| > Attendre : 15 Frames |
| >| >| >| > |
| >| >| > Sinon |
| >| >| >| > Appeler Script : SV[4] -= 1 |
| >| >| >| > |
| >| >| > Fin - Condition |
| >| >| > |
| >| > Fin - Condition |
| >| > Condition : la touche Droite est pressée |
| >| >| > Condition : la touche B est pressée |
| >| >| >| > Appeler Script : SV[2] += 1 |
| >| >| >| > Attendre : 15 Frames |
| >| >| >| > |
| >| >| > Sinon |
| >| >| >| > Appeler Script : SV[4] += 1 |
| >| >| >| > |
| >| >| > Fin - Condition |
| >| >| > |
| >| > Fin - Condition |
| >| > Condition : la touche C est pressée |
| >| >| > Appeler Script : SV[4] = picture_x(1) |
| >| >| > Appeler Script : SV[5] = picture_y(1) |
| >| >| > Appeler Script : SV[7] = "picture_show(1, 'nom_de_limage', #{SV[4]}, #{SV[5]})" |
| >| >| > Appeler Script : clipboard_push_text(SV[7]) |
| >| >| > Appeler Script : puts "Commande envoyée" |
| >| >| > Attendre : 30 Frames |
| >| >| > |
| >| > Fin - Condition |
| >| > Commentaire : Déplacement de l'image pointée |
| >| > Appeler Script : picture_position(1, SV[4], SV[5]) |
| >| > Appeler Script : camera_move_on(SV[2], SV[3]) |
| >| > Attendre : 1 Frames |
| >| > Condition : la touche A est pressée |
| >| >| > Attendre : 15 Frames |
| >| >| > |
| >| > Fin - Condition |
| >| > |
| > Fin - Boucle |
| > |