Cette page vous donne les différences entre la révision choisie et la version actuelle de la page.
ags50 01/05/2011 22:06 | ags50 02/05/2011 11:41 version actuelle | ||
---|---|---|---|
Ligne 33: | Ligne 33: | ||
rend l'arrière-plan de la pièce entièrement jaune, puis dessine un cercle rose en son milieu.\\ \\ | rend l'arrière-plan de la pièce entièrement jaune, puis dessine un cercle rose en son milieu.\\ \\ | ||
- | // Voir aussi : // [[ags50#DrawingSurface.DrawingColor|DrawingSurface.DrawingColor]]\\ \\ | + | // Voir aussi : // [[ags50#DrawingColor|DrawingSurface.DrawingColor]]\\ \\ |
Ligne 66: | Ligne 66: | ||
fera une copie de sauvegarde de l'arrière-plan de la pièce, dessinera un triangle dessus, | fera une copie de sauvegarde de l'arrière-plan de la pièce, dessinera un triangle dessus, | ||
attendra un moment puis restaurera l'arrière-plan original.\\ \\ | attendra un moment puis restaurera l'arrière-plan original.\\ \\ | ||
- | // Voir aussi : // [[ags50#DrawingSurface.DrawSurface|DrawingSurface.DrawSurface]]\\ \\ | + | // Voir aussi : // [[ags50#DrawSurface|DrawingSurface.DrawSurface]]\\ \\ |
Ligne 86: | Ligne 86: | ||
dessinera un cercle jaune au centre de l'écran, d'un rayon de 50 pixels.\\ \\ | dessinera un cercle jaune au centre de l'écran, d'un rayon de 50 pixels.\\ \\ | ||
- | // Voir aussi : // [[ags50#DrawingSurface.DrawLine|DrawingSurface.DrawLine]], | + | // Voir aussi : // [[ags50#DrawLine|DrawingSurface.DrawLine]], |
- | [[ags50#DrawingSurface.DrawingColor|DrawingSurface.DrawingColor]]\\ \\ | + | [[ags50#DrawingColor|DrawingSurface.DrawingColor]]\\ \\ |
Ligne 100: | Ligne 100: | ||
// (Anciennement RawDrawImageTransparent, désormais obsolète) // \\ \\ | // (Anciennement RawDrawImageTransparent, désormais obsolète) // \\ \\ | ||
- | DrawingSurface.DrawImage(int x, int y, int slot, optional int transparency, | + | DrawingSurface.DrawImage(int x, int y, int bloc, optional int transparence, |
- | optional int width, optional int height) | + | optional int largeur, optional int hauteur) |
- | Draws image SLOT from the sprite manager onto the surface at location (X,Y).\\ \\ | + | Dessine l'image BLOC du gestionnaire de sprite sur la surface aux coordonnées (X,Y).\\ \\ |
- | Optionally, you can also specify the transparency of the image. This is a number | + | Facultativement, vous pouvez aussi spécifier la transparence de l'image. Cela correspond |
- | from 0-100; using a // transparency // of 50 will draw the image semi-transparent; | + | à un nombre de 0 à 100 ; passer une valeur de 50 pour // transparence // dessinera l'image |
- | using 0 means it will not be transparent.\\ \\ | + | à moitié transparente ; passer 0 signifiera que l'image n'est pas transparente du tout.\\ \\ |
- | You can also resize the image as you draw it. In order to do this, simply specify | + | Vous pouvez aussi redimensionner l'image que vous dessinez. Pour cela, spécifiez simplement les |
- | a // width // and // height // that you wish to resize the image to when it is drawn.\\ \\ | + | // largeur // et // hauteur // auxquelles vous voulez redimensionner l'image sur le dessin.\\ \\ |
- | ** NOTE: ** This command only works if the image to be drawn is the same colour | + | ** NOTE : ** Cette commande ne fonctionne que si l'image à dessiner est de la même profondeur de |
- | depth as the surface that you are drawing onto.\\ \\ | + | couleur que la surface sur laquelle vous dessinez.\\ \\ |
- | ** NOTE: ** Transparency does not work in 256-colour games, or with 256-colour sprites.\\ \\ | + | ** NOTE : ** La transparence ne marche pas dans les jeux 256 couleurs, ou avec des sprites 256 couleurs.\\ \\ |
- | ** NOTE: ** The X and Y co-ordinates given are ROOM co-ordinates, not SCREEN co-ordinates. | + | ** NOTE : ** Les coordonnées X et Y correspondent à celles de la PIECE, et non à celles de l'ECRAN. |
- | This means that in a scrolling room you can draw outside the current visible area.\\ \\ | + | Cela signifie que dans une pièce à défilement, vous pouvez dessiner hors de la zone actuellement visible.\\ \\ |
Exemple : | Exemple : | ||
DrawingSurface *surface = Room.GetDrawingSurfaceForBackground(); | DrawingSurface *surface = Room.GetDrawingSurfaceForBackground(); | ||
- | surface.DrawImage(100, 100, oDoor.Graphic, 40); | + | surface.DrawImage(100, 100, oPorte.Graphic, 40); |
surface.Release(); | surface.Release(); | ||
- | will draw the // oDoor // object's graphic onto the room background at (100, 100), at 40% | + | dessinera l'image de l'objet // oPorte // sur l'arrière-plan à (100,100), à 40% de transparence.\\ \\ |
- | transparency.\\ \\ | + | |
// Voir aussi : // | // Voir aussi : // | ||
- | [[ags50#DrawingSurface.DrawLine|DrawingSurface.DrawLine]], | + | [[ags50#DrawLine|DrawingSurface.DrawLine]], |
- | [[ags50#DrawingSurface.DrawString|DrawingSurface.DrawString]], | + | [[ags50#DrawString|DrawingSurface.DrawString]], |
- | [[ags50#DrawingSurface.DrawSurface|DrawingSurface.DrawSurface]], | + | [[ags50#DrawSurface|DrawingSurface.DrawSurface]], |
[[ags72#Room.ColorDepth|Room.ColorDepth]]\\ \\ | [[ags72#Room.ColorDepth|Room.ColorDepth]]\\ \\ | ||
Ligne 135: | Ligne 134: | ||
// (Anciennement RawDrawLine, désormais obsolète) // \\ \\ | // (Anciennement RawDrawLine, désormais obsolète) // \\ \\ | ||
- | DrawingSurface.DrawLine(int from_x, int from_y, int to_x, int to_y, | + | DrawingSurface.DrawLine(int depuis_x, int depuis_y, int a_x, int a_y, |
- | optional int thickness) | + | optional int epaisseur) |
- | Draws a line from (FROM_X, FROM_Y) to (TO_X, TO_Y) in the surface's current drawing colour.\\ \\ | + | Dessine une ligne depuis (depuis_x, depuis_y) jusqu'à (a_x, a_y) de la couleur en cours pour la surface.\\ \\ |
- | The // thickness // parameter allows you to specify how thick the line is, the default being 1 pixel.\\ \\ | + | Le paramètre // epaisseur // vous permet de spécifier l'épaisseur de la ligne, de 1 pixel par défaut.\\ \\ |
- | ** NOTE: ** The X and Y co-ordinates given are ROOM co-ordinates, not SCREEN co-ordinates. | + | ** NOTE : ** Les coordonnées X et Y sont les coordonnées de la PIECE, pas de l'ECRAN. |
- | This means that in a scrolling room you can draw outside the current visible area.\\ \\ | + | Cela signifie que dans une pièce à défilement, vous pouvez dessiner hors de la zone actuellement visible.\\ \\ |
Exemple : | Exemple : | ||
Ligne 149: | Ligne 148: | ||
surface.Release(); | surface.Release(); | ||
- | will draw a line from the left top of the screen (0,0) to the middle of the screen (160,100);\\ \\ | + | dessinera une ligne qui part du coin supérieur gauche de l'écran (0,0) jusqu'au milieu (160, 100).\\ \\ |
- | // Voir aussi : // [[ags50#DrawingSurface.DrawCircle|DrawingSurface.DrawCircle]], | + | // Voir aussi : // [[ags50#DrawCircle|DrawingSurface.DrawCircle]], |
- | [[ags50#DrawingSurface.DrawRectangle|DrawingSurface.DrawRectangle]], | + | [[ags50#DrawRectangle|DrawingSurface.DrawRectangle]], |
- | [[ags50#DrawingSurface.DrawTriangle|DrawingSurface.DrawTriangle]], | + | [[ags50#DrawTriangle|DrawingSurface.DrawTriangle]], |
- | [[ags50#DrawingSurface.DrawingColor|DrawingSurface.DrawingColor]]\\ \\ | + | [[ags50#DrawingColor|DrawingSurface.DrawingColor]]\\ \\ |
Ligne 162: | Ligne 161: | ||
// (Anciennement RawPrintMessageWrapped, désormais obsolète) // \\ \\ | // (Anciennement RawPrintMessageWrapped, désormais obsolète) // \\ \\ | ||
- | DrawingSurface.DrawMessageWrapped(int x, int y, int width, | + | DrawingSurface.DrawMessageWrapped(int x, int y, int largeur, |
- | FontType font, int message_number) | + | FontType police, int numero_message) |
- | Draws the room message MESSAGE_NUMBER onto the surface at (x,y), using the | + | Dessine le message NUMERO_MESSAGE sur la surface à (X,Y), en utilisant la POLICE |
- | specified FONT.\\ \\ | + | spécifiée.\\ \\ |
- | WIDTH is the width of the virtual textbox enclosing the text, and is the point that | + | LARGEUR correspond à la largeur du cadre virtuelle entourant le texte, et après laquelle |
- | the text will wrap at. This command is designed for writing a long message to the | + | le texte sera retourné à la ligne. Cette commande est conçue pour écrire un long message à l'écran |
- | screen with it wrapping normally like a standard label would do.\\ \\ | + | tout en le formattant normalement comme le ferait une étiquette (//label//) classique.\\ \\ |
- | The text will be printed using the current drawing colour.\\ \\ | + | Le texte sera dessiné dans la couleur de dessin courante.\\ \\ |
Exemple : | Exemple : | ||
Ligne 178: | Ligne 177: | ||
surface.Release(); | surface.Release(); | ||
- | will display message 10 in the centre of the screen, starting from Y = 40.\\ \\ | + | affichera le message 10 au centre de l'écran, en commençant à Y = 40.\\ \\ |
- | // Voir aussi : // [[ags50#DrawingSurface.DrawString|DrawingSurface.DrawString]], | + | // Voir aussi : // [[ags50#DrawString|DrawingSurface.DrawString]], |
- | [[ags50#DrawingSurface.DrawingColor|DrawingSurface.DrawingColor]], | + | [[ags50#DrawingColor|DrawingSurface.DrawingColor]], |
- | [[ags50#DrawingSurface.DrawStringWrapped|DrawingSurface.DrawStringWrapped]]\\ \\ | + | [[ags50#DrawStringWrapped|DrawingSurface.DrawStringWrapped]]\\ \\ |
Ligne 191: | Ligne 190: | ||
DrawingSurface.DrawPixel(int x, int y) | DrawingSurface.DrawPixel(int x, int y) | ||
- | Draws a single pixel onto the surface at (X,Y) in the current colour. The pixel | + | Dessine un simple pixel sur la surface à (X,Y) dans la couleur courante. L'épaisseur |
- | thickness respects the [[ags50#DrawingSurface.UseHighResCoordinates|UseHighResCoordinates]] | + | du pixel est définie par la propriété [[ags50#UseHighResCoordinates|UseHighResCoordinates]].\\ \\ |
- | property.\\ \\ | + | ** NOTE : ** Cette commande n'est pas suffisamment rapide pour l'utiliser en répétition afin |
- | ** NOTE: ** This command is not fast enough to use repeatedly to build up an image. Only | + | de créer une image complète. Ne l'utilisez que pour de simples ajustements de pixels.\\ \\ |
- | use it for single pixel adjustments.\\ \\ | + | |
Exemple : | Exemple : | ||
Ligne 203: | Ligne 201: | ||
surface.Release(); | surface.Release(); | ||
- | draws a yellow pixel in the top left of the room background\\ \\ | + | dessine un pixel jaune au coin supérieur gauche de l'arrière-plan.\\ \\ |
- | // Voir aussi : // [[ags50#DrawingSurface.DrawingColor|DrawingSurface.DrawingColor]], | + | // Voir aussi : // [[ags50#DrawingColor|DrawingSurface.DrawingColor]], |
- | [[ags50#DrawingSurface.DrawLine|DrawingSurface.DrawLine]], | + | [[ags50#DrawLine|DrawingSurface.DrawLine]], |
- | [[ags50#DrawingSurface.GetPixel|DrawingSurface.GetPixel]], | + | [[ags50#GetPixel|DrawingSurface.GetPixel]], |
- | [[ags50#DrawingSurface.UseHighResCoordinates|DrawingSurface.UseHighResCoordinates]]\\ \\ | + | [[ags50#UseHighResCoordinates|DrawingSurface.UseHighResCoordinates]]\\ \\ |
Ligne 218: | Ligne 216: | ||
DrawingSurface.DrawRectangle(int x1, int y1, int x2, int y2) | DrawingSurface.DrawRectangle(int x1, int y1, int x2, int y2) | ||
- | Draws a filled rectangle in the current colour with its top-left corner | + | Dessine un rectangle plein dans la couleur courante avec son coin supérieur gauche |
- | at (x1,y1) and its bottom right corner at (x2, y2)\\ \\ | + | à (X1,Y1) et son coin inférieur droit à (X2,Y2).\\ \\ |
- | ** NOTE: ** The X and Y co-ordinates given are ROOM co-ordinates, not SCREEN co-ordinates. | + | ** NOTE : ** Les coordonnées X et Y sont celles de la PIECE, pas celles de l'ECRAN. |
- | This means that in a scrolling room you can draw outside the current visible area.\\ \\ | + | Cela signifie que dans une pièce à défilement vous pouvez dessiner hors de la zone actuellement visible.\\ \\ |
Exemple : | Exemple : | ||
Ligne 229: | Ligne 227: | ||
surface.Release(); | surface.Release(); | ||
- | will draw a rectangle over the top left hand quarter of the screen.\\ \\ | + | dessinera un rectangle sur le quart haut gauche de l'écran.\\ \\ |
- | // Voir aussi : // [[ags50#DrawingSurface.DrawImage|DrawingSurface.DrawImage]], | + | // Voir aussi : // [[ags50#DrawImage|DrawingSurface.DrawImage]], |
- | [[ags50#DrawingSurface.DrawLine|DrawingSurface.DrawLine]]\\ \\ | + | [[ags50#DrawLine|DrawingSurface.DrawLine]]\\ \\ |
Ligne 240: | Ligne 238: | ||
// (Anciennement RawPrint, désormais obsolète) // \\ \\ | // (Anciennement RawPrint, désormais obsolète) // \\ \\ | ||
- | DrawingSurface.DrawString(int x, int y, FontType font, string text, ...) | + | DrawingSurface.DrawString(int x, int y, FontType police, string texte, ...) |
- | Draws the // text // onto the surface at (x, y), using the supplied font number. | + | Dessine le // texte // sur la surface à (X, Y), en utilisant le numéro de police spécifié. |
- | The text will be drawn in the current drawing colour.\\ \\ | + | Le texte sera dessiné dans la couleur de dessin courante.\\ \\ |
- | You can insert the value of variables into the message. For more information, | + | Vous pouvez insérer des valeurs de variables dans le message. Pour plus d'information, |
- | see the [[ags36#StringFormats|string formatting]] section.\\ \\ | + | voyez la section [[ags36#StringFormats|formatage des chaînes de caractères]].\\ \\ |
Exemple : | Exemple : | ||
Ligne 253: | Ligne 251: | ||
surface.Release(); | surface.Release(); | ||
- | will write some text onto the middle-left of the room background\\ \\ | + | dessinera du texte sur le milieu gauche de l'arrière-plan.\\ \\ |
// Voir aussi : // [[ags53#GetTextWidth|GetTextWidth]], | // Voir aussi : // [[ags53#GetTextWidth|GetTextWidth]], | ||
- | [[ags50#DrawingSurface.DrawStringWrapped|DrawingSurface.DrawStringWrapped]], | + | [[ags50#DrawStringWrapped|DrawingSurface.DrawStringWrapped]], |
- | [[ags50#DrawingSurface.DrawingColor|DrawingSurface.DrawingColor]]\\ \\ | + | [[ags50#DrawingColor|DrawingSurface.DrawingColor]]\\ \\ |
Ligne 264: | Ligne 262: | ||
====DrawStringWrapped==== | ====DrawStringWrapped==== | ||
- | DrawingSurface.DrawStringWrapped(int x, int y, int width, | + | DrawingSurface.DrawStringWrapped(int x, int y, int largeur, |
- | FontType font, Alignment, | + | FontType police, Alignment, |
- | const string text) | + | const string texte) |
- | Draws the // text // onto the surface at (x,y), using the specified FONT.\\ \\ | + | Dessine le // texte // sur la surface à (X,Y), en utilisant la POLICE spécifiée.\\ \\ |
- | // width // is the width of the virtual textbox enclosing the text, and is the point | + | // largeur // correspond à la largeur du cadre virtuel entourant le texte, et correspond |
- | that the text will wrap at. You can use the // alignment // parameter to determine | + | au point où le texte sera retourné à la ligne. Vous pouvez utiliser le paramètre // alignment // |
- | how the text is horizontally aligned.\\ \\ | + | pour déterminer comment le texte sera horizontalement aligné.\\ \\ |
- | The text will be printed using the current drawing colour.\\ \\ | + | Le texte sera dessiné en utilisant la couleur de dessin en cours.\\ \\ |
Exemple : | Exemple : | ||
Ligne 280: | Ligne 278: | ||
surface.Release(); | surface.Release(); | ||
- | will display the text in the centre of the screen, starting from Y = 40.\\ \\ | + | affichera le texte au centre de l'écran, en commençant à Y = 50.\\ \\ |
- | // Compatibility: // Supported by ** AGS 3.0.1 ** and later versions.\\ \\ | + | // Compatibilité : // Supporté par ** AGS 3.0.1 ** et les versions plus récentes.\\ \\ |
- | // Voir aussi : // [[ags50#DrawingSurface.DrawString|DrawingSurface.DrawString]], | + | // Voir aussi : // [[ags50#DrawString|DrawingSurface.DrawString]], |
- | [[ags50#DrawingSurface.DrawingColor|DrawingSurface.DrawingColor]], | + | [[ags50#DrawingColor|DrawingSurface.DrawingColor]], |
- | [[ags50#DrawingSurface.DrawMessageWrapped|DrawingSurface.DrawMessageWrapped]]\\ \\ | + | [[ags50#DrawMessageWrapped|DrawingSurface.DrawMessageWrapped]]\\ \\ |
Ligne 295: | Ligne 293: | ||
// (Anciennement RawRestoreScreen, désormais obsolète) // \\ \\ | // (Anciennement RawRestoreScreen, désormais obsolète) // \\ \\ | ||
- | DrawingSurface.DrawSurface(DrawingSurface *source, optional int transparency) | + | DrawingSurface.DrawSurface(DrawingSurface *source, optional int transparence) |
- | Draws the specified surface on top of this surface, optionally using // transparency // | + | Dessine la surface spécifiée sur cette surface, en utilisant optionnellement une transparence |
- | percent transparency.\\ \\ | + | de //transparence// pour-cent.\\ \\ |
- | This allows you to perform day-to-night fading and other special effects.\\ \\ | + | Ceci vous permet d'effectuer des fondus de tombée de nuit ou d'autres effets spéciaux.\\ \\ |
- | ** NOTE: ** You cannot use the // transparency // parameter with 256-colour surfaces.\\ \\ | + | ** NOTE : ** Vous ne pouvez pas utiliser le paramètre //transparence// sur les surfaces 256 couleurs.\\ \\ |
- | ** NOTE: ** This command can be a bit on the slow side, so don't call it from repeatedly_execute.\\ \\ | + | ** NOTE : ** Cette commande peut être assez lente, ne l'appelez donc pas dans repeatedly_execute.\\ \\ |
- | ** TIP: ** If you want to gradually fade in a second background, create a copy of | + | ** ASTUCE : ** Si vous voulez fondre graduellement vers un second arrière-plan, créez une copie de la surface originale |
- | the original surface and then restore it after each iteration, otherwise the backgrounds | + | puis restaurez-la à chaque itération, sinon l'arrière-plan changera trop rapidement.\\ \\ |
- | will converge too quickly.\\ \\ | + | |
Exemple : | Exemple : | ||
Ligne 313: | Ligne 310: | ||
nightBackground.Release(); | nightBackground.Release(); | ||
- | this will draw background frame 1 onto frame 0 at 50% opacity.\\ \\ | + | ceci dessinera l'image d'arrière-plan 1 sur l'image 0 à 50% d'opacité.\\ \\ |
- | // Voir aussi : // [[ags50#DrawingSurface.DrawImage|DrawingSurface.DrawImage]], | + | // Voir aussi : // [[ags50#DrawImage|DrawingSurface.DrawImage]], |
[[ags53#SetAmbientTint|SetAmbientTint]]\\ \\ | [[ags53#SetAmbientTint|SetAmbientTint]]\\ \\ | ||
Ligne 326: | Ligne 323: | ||
DrawingSurface.DrawTriangle(int x1, int y1, int x2, int y2, int x3, int y3) | DrawingSurface.DrawTriangle(int x1, int y1, int x2, int y2, int x3, int y3) | ||
- | Draws a filled triangle in the current colour with corners at the points | + | Dessine un triangle plein dans la couleur en cours avec ses coins aux points |
- | (x1,y1), (x2,y2) and (x3,y3).\\ \\ | + | (X1,Y1), (X2,Y2) et (X3,Y3).\\ \\ |
- | Well, don't look at me, you might find it useful for something :-)\\ \\ | + | Oui, bon, me regardez pas comme ça, vous pourriez trouver ça utile pour quelque chose :-)\\ \\ |
Exemple : | Exemple : | ||
Ligne 336: | Ligne 333: | ||
surface.Release(); | surface.Release(); | ||
- | will draw a triangle with corners at the points (0,0),(160,100),(0,200).\\ \\ | + | dessinera un triangle avec les coins aux points (0,0),(160,100),(0,200).\\ \\ |
- | // Voir aussi : // [[ags50#DrawingSurface.DrawImage|DrawingSurface.DrawImage]], | + | // Voir aussi : // [[ags50#DrawImage|DrawingSurface.DrawImage]], |
- | [[ags50#DrawingSurface.DrawLine|DrawingSurface.DrawLine]], | + | [[ags50#DrawLine|DrawingSurface.DrawLine]], |
- | [[ags50#DrawingSurface.DrawRectangle|DrawingSurface.DrawRectangle]]\\ \\ | + | [[ags50#DrawRectangle|DrawingSurface.DrawRectangle]]\\ \\ |
Ligne 349: | Ligne 346: | ||
DrawingSurface.Release() | DrawingSurface.Release() | ||
- | Tells AGS that you have finished drawing onto this surface, and that AGS can now upload | + | Informe AGS que vous avez fini de dessiner sur la surface, et lui permet de charger l'image |
- | the changed image into video memory.\\ \\ | + | modifiée dans la mémoire vidéo.\\ \\ |
- | After calling this method, you can no longer use the DrawingSurface instance. To do | + | Après avoir appelé cette méthode, vous ne pouvez plus utiliser la variable DrawingSurface. |
- | any further drawing, you need to get the surface again.\\ \\ | + | Pour tout changement, vous devrez récupérer la surface à nouveau.\\ \\ |
Exemple : | Exemple : | ||
Ligne 360: | Ligne 357: | ||
surface.Release(); | surface.Release(); | ||
- | draws a yellow diagonal line across the top-left of the current room background, | + | dessine une ligne diagonale jaune à travers le coin supérieur gauche de l'arrière-plan en cours, |
- | then releases the image.\\ \\ | + | puis affiche l'image.\\ \\ |
// Voir aussi : // [[ags51#DynamicSprite.GetDrawingSurface|DynamicSprite.GetDrawingSurface]], | // Voir aussi : // [[ags51#DynamicSprite.GetDrawingSurface|DynamicSprite.GetDrawingSurface]], | ||
[[ags72#Room.GetDrawingSurfaceForBackground|Room.GetDrawingSurfaceForBackground]]\\ \\ | [[ags72#Room.GetDrawingSurfaceForBackground|Room.GetDrawingSurfaceForBackground]]\\ \\ | ||
Ligne 374: | Ligne 371: | ||
int DrawingSurface.DrawingColor | int DrawingSurface.DrawingColor | ||
- | Gets/sets the current drawing colour on this surface. Set this before using commands | + | Retourne/Définit la couleur de dessin courante sur la surface. Définissez-la avant d'utiliser |
- | like [[ags50#DrawingSurface.DrawLine|DrawLine]], which use this colour for | + | des commandes comme [[ags50#DrawLine|DrawLine]], qui utilisent cette couleur pour dessiner.\\ \\ |
- | their drawing.\\ \\ | + | Vous pouvez soit donner un Numéro de Couleur AGS (//AGS Colour Number//) (comme affichée dans l'onglet |
- | You can set this either to an AGS Colour Number (as you'd get from the Colours pane | + | Colour de l'éditeur) ou la constante spéciale COLOR_TRANSPARENT, ce qui vous permet de dessiner |
- | in the editor) or to the special constant COLOR_TRANSPARENT, which allows you | + | des zones transparentes sur la surface.\\ \\ |
- | to draw transparent areas onto the surface.\\ \\ | + | |
Exemple : | Exemple : | ||
Ligne 389: | Ligne 385: | ||
surface.Release(); | surface.Release(); | ||
- | will draw a yellow line from the left top of the screen (0,0) to the middle of the screen (160,100), | + | affichera une ligne gauche depuis le coin supérieur gauche de l'écran (0,0) jusqu'au milieu (160,100), |
- | and a white line from the bottom left to the middle.\\ \\ | + | puis une ligne blanche depuis le coin inférieur gauche jusqu'au le milieu.\\ \\ |
- | // Voir aussi : // [[ags50#DrawingSurface.DrawCircle|DrawingSurface.DrawCircle]], | + | // Voir aussi : // [[ags50#DrawCircle|DrawingSurface.DrawCircle]], |
- | [[ags50#DrawingSurface.DrawLine|DrawingSurface.DrawLine]], | + | [[ags50#DrawLine|DrawingSurface.DrawLine]], |
- | [[ags50#DrawingSurface.DrawRectangle|DrawingSurface.DrawRectangle]], | + | [[ags50#DrawRectangle|DrawingSurface.DrawRectangle]], |
[[ags53#Game.GetColorFromRGB|Game.GetColorFromRGB]]\\ \\ | [[ags53#Game.GetColorFromRGB|Game.GetColorFromRGB]]\\ \\ | ||
Ligne 404: | Ligne 400: | ||
int DrawingSurface.GetPixel(int x, int y) | int DrawingSurface.GetPixel(int x, int y) | ||
- | Returns the AGS Colour Number of the pixel at (X,Y) on the surface.\\ \\ | + | Retourne le Numéro de Couleur AGS (//AGS Colour Number//) du pixel au point (X,Y) de la surface.\\ \\ |
- | ** NOTE: ** In high-colour games, the first 32 colour numbers have a special meaning | + | ** NOTE : ** Dans un jeu hautes-couleurs, les 32 premiers numéros de couleur ont un sens spécial, |
- | due to an AGS feature which maintains compatibility with 8-bit games. Therefore, if | + | car AGS les utilise pour maintenir la compatibilité avec les jeux 8-bits. Ainsi, si vous dessinez sur |
- | you draw onto the surface using a blue colour number 0-31 you will get a different number | + | la surface en utilisant une couleur bleu de numéro 0 à 31, vous obtiendrez un numéro différent lorsque |
- | when you GetPixel -- and in fact the colour drawn may not be what you expect. | + | vous appellerez GetPixel -- et en fait la couleur dessinée pourrait ne pas correspondre à ce que vous |
- | To get around this, add 1 Red or Green component to adjust the colour number out of this range.\\ \\ | + | attendez. |
- | ** NOTE: ** This command is relatively slow. Don't use it to try and process an entire image.\\ \\ | + | Pour vous en sortir, ajoutez simplement une valeur de 1 de Rouge et de Vert pour ajuster le numéro de |
+ | la couleur hors de cet intervalle.\\ \\ | ||
+ | ** NOTE : ** Cette commande est relativement lente. Ne l'utilisez pas pour tenter de traiter l'image | ||
+ | entière.\\ \\ | ||
Exemple : | Exemple : | ||
Ligne 417: | Ligne 416: | ||
surface.Release(); | surface.Release(); | ||
- | displays the pixel colour of the centre pixel on the screen.\\ \\ | + | affiche la couleur du pixel du centre de l'écran.\\ \\ |
- | // Compatibility: // Supported by ** AGS 3.0.1 ** and later versions.\\ \\ | + | // Compatibilité : // Supporté par ** AGS 3.0.1 ** et les versions plus récentes.\\ \\ |
- | // Voir aussi : // [[ags50#DrawingSurface.DrawingColor|DrawingSurface.DrawingColor]], | + | // Voir aussi : // [[ags50#DrawingColor|DrawingSurface.DrawingColor]], |
- | [[ags50#DrawingSurface.DrawPixel|DrawingSurface.DrawPixel]], | + | [[ags50#DrawPixel|DrawingSurface.DrawPixel]], |
- | [[ags50#DrawingSurface.UseHighResCoordinates|DrawingSurface.UseHighResCoordinates]]\\ \\ | + | [[ags50#UseHighResCoordinates|DrawingSurface.UseHighResCoordinates]]\\ \\ |
Ligne 431: | Ligne 430: | ||
readonly int DrawingSurface.Height | readonly int DrawingSurface.Height | ||
- | Gets the height of the surface.\\ \\ | + | Retourne la hauteur de la surface.\\ \\ |
Exemple : | Exemple : | ||
DrawingSurface *surface = Room.GetDrawingSurfaceForBackground(); | DrawingSurface *surface = Room.GetDrawingSurfaceForBackground(); | ||
- | Display("The background is %d x %d!", surface.Width, surface.Height); | + | Display("L'arrière-plan est de dimension %d x %d !", surface.Width, surface.Height); |
surface.Release(); | surface.Release(); | ||
- | displays the size of the surface to the player\\ \\ | + | affiche la dimension de la surface au joueur.\\ \\ |
- | // Voir aussi : // [[ags50#DrawingSurface.UseHighResCoordinates|DrawingSurface.UseHighResCoordinates]], | + | // Voir aussi : // [[ags50#UseHighResCoordinates|DrawingSurface.UseHighResCoordinates]], |
- | [[ags50#DrawingSurface.Width|DrawingSurface.Width]]\\ \\ | + | [[ags50#Width|DrawingSurface.Width]]\\ \\ |
Ligne 450: | Ligne 449: | ||
bool DrawingSurface.UseHighResCoordinates | bool DrawingSurface.UseHighResCoordinates | ||
- | Gets/sets whether you want to use high-resolution co-ordinates with this surface.\\ \\ | + | Retourne/Définit si vous voulez utiliser les coordonnées haute-résolution sur cette surface.\\ \\ |
- | By default, this property will be set such that drawing surface co-ordinates use the same | + | Par défaut, cette propriété sera définie de façon à ce que les coordonnées de la surface de |
- | co-ordinate system as the rest of the game, as per the "Use low-res co-ordinates in script" | + | dessin utilisent les coordonnées du système comme le reste de l'écran, comme pour le réglage |
- | game setting. However, if your game is 640x400 or higher you can customize whether | + | de jeu "Use low-res co-ordinates in script" ("//Utiliser les coordonnées basse-résolution dans le script//") |
- | this drawing surface uses native co-ordinates or the low-res 320x200 co-ordinates by | + | Toutefois, si votre jeu est en 640x400 ou supérieur, vous pouvez choisir si la surface |
- | changing this property.\\ \\ | + | utilisé les coordonnées natives ou les coordonnées de basse-résolution 320x200 en changeant |
- | Setting this property affects ** ALL ** other commands performed on this drawing | + | cette propriété.\\ \\ |
- | surface, including the [[ags50#DrawingSurface.Width|Width]] and [[ags50#DrawingSurface.Height|Height]] | + | En définissant cette propriété vous affectez ** TOUTES ** les autres commandes effectuées sur |
- | properties.\\ \\ | + | cette surface de dessin, incluant les propriétés [[ags50#Width|Width]] et [[ags50#Height|Height]].\\ \\ |
Exemple : | Exemple : | ||
Ligne 467: | Ligne 466: | ||
surface.Release(); | surface.Release(); | ||
- | draws a yellow line from the top left of the screen to the middle of the screen. If we | + | dessine une ligne jaue depuis le coin gauche supérieur de l'écran jusqu'au milieu. |
- | hadn't set // UseHighResCoordinates // to true, this would draw a line from the top left | + | Si // UseHighResCoordinates // ne valait pas //true//, cela dessinera la ligne depuis |
- | to the bottom right of the screen.\\ \\ | + | le coin gauche supérieur jusqu'au coin inférieur bas de l'écran.\\ \\ |
- | // Voir aussi : // [[ags50#DrawingSurface.DrawCircle|DrawingSurface.DrawCircle]], [[ags50#DrawingSurface.DrawLine|DrawingSurface.DrawLine]], | + | // Voir aussi : // [[ags50#DrawCircle|DrawingSurface.DrawCircle]], [[ags50#DrawLine|DrawingSurface.DrawLine]], |
- | [[ags50#DrawingSurface.DrawRectangle|DrawingSurface.DrawRectangle]], | + | [[ags50#DrawRectangle|DrawingSurface.DrawRectangle]], |
- | [[ags50#DrawingSurface.DrawTriangle|DrawingSurface.DrawTriangle]]\\ \\ | + | [[ags50#DrawTriangle|DrawingSurface.DrawTriangle]]\\ \\ |
Ligne 482: | Ligne 481: | ||
readonly int DrawingSurface.Width | readonly int DrawingSurface.Width | ||
- | Gets the width of the surface.\\ \\ | + | Retourne la largeur de la surface.\\ \\ |
Exemple : | Exemple : | ||
DrawingSurface *surface = Room.GetDrawingSurfaceForBackground(); | DrawingSurface *surface = Room.GetDrawingSurfaceForBackground(); | ||
- | Display("The background is %d x %d!", surface.Width, surface.Height); | + | Display("L'arrière-plan est de dimension %d x %d !", surface.Width, surface.Height); |
surface.Release(); | surface.Release(); | ||
- | displays the size of the surface to the player\\ \\ | + | affiche la taille de la surface au joueur.\\ \\ |
- | // Voir aussi : // [[ags50#DrawingSurface.Height|DrawingSurface.Height]], | + | // Voir aussi : // [[ags50#Height|DrawingSurface.Height]], |
- | [[ags50#DrawingSurface.UseHighResCoordinates|DrawingSurface.UseHighResCoordinates]] | + | [[ags50#UseHighResCoordinates|DrawingSurface.UseHighResCoordinates]] |
- | {{tag>en_cours}} | + | {{tag>français}} |