zebdal Utilisateur confirmé: Rang *****
Messages : 2874 Localisation : Chez Vanilla Projet Actuel : Shrapnel
Kanon
Sengoku Rance Online
Vanilla H
| Sujet: Besoin d'un cours sur les fonts et la police Ven 3 Juil 2009 - 19:39 | |
| J'ai besoin de savoir comment modifier les fonts, la taille, grosseur, etc... de la police, tout ce qui concerne l'affichage de texte... y a t'il quelqu'un pour m'apprendre ca vite fait ici ou ailleurs |
|
arthuro Utilisateur confirmé: Rang ****
Messages : 1480 Localisation : Paris Projet Actuel : Diagon https://arthursonzogni.com/Diagon
| Sujet: Re: Besoin d'un cours sur les fonts et la police Ven 3 Juil 2009 - 20:49 | |
| modifier les fonts
ya plein de trucs différent, si tu veux un effet particulier, précise plus tard. La principal chose pour modifier est de changer de font. -create a new font. puis -draw_set_font() pour que Gm l'utilise modifier la taille, grosseurtu peux toujours utiliser un nouveau font par taille. sinon les fonction qui possède les argument xscale et yscale pour étirer le texte
- Fonts and Textdraw_text_transformed(x,y,string,xscale,yscale,angle)
- Draws the string at position (x,y) in the same way as above, but scale it
- horizontally and vertically with the indicated factors and rotate it
- counter-clockwise over angle
- degrees.
- draw_text_ext_transformed(x,y,string,sep,w,xscale,yscale,angle)
- Combines the function draw_text_ext and draw_text_transformed.
- It makes it possible to draw a multi-line text rotated and
- scaled.
- draw_text_color(x,y,string,c1,c2,c3,c4,alpha) Draws
- the string at position (x,y) like above. The four colors specify the colors of
- the top-left, top-right, bottom-right, and bottom-left corner of the text.
- alpha is the alpha transparency to be used
- (0-1).
- draw_text_ext_color(x,y,string,sep,w,c1,c2,c3,c4,alpha)
- Similar to draw_text_ext() but with colored
- vertices.
- draw_text_transformed_color(x,y,string,xscale,yscale,angle,c1,c2,c3,c4,alpha)
- Similar to draw_text_transformed() but with colored
- vertices.
- draw_text_ext_transformed_color(x,y,string,sep,w,xscale,yscale,angle,c1,c2,c3,c4,alpha)
- Similar to draw_text_ext_transformed() but with colored
- vertices.
Tous se qui concerne l'affichage du texteLa doc de gm est parfaite pour savoir sa. - Spoiler:
Fonts and Text In games you sometimes need to draw texts. To draw a text you have to specify the font to use. Fonts can be defined by creating font resources (either in the Game Maker program or using the functions to create resources). There are different functions to draw texts in different way. In each function you specify the position of the text on the screen. There are two functions to set the horizontal and vertical alignment of the text with respect to that position. For text drawing the following functions exist: <blockquote>draw_set_font(font) Sets the font that will be used when drawing text. Use -1 to set the default font (Arial 12). draw_set_halign(halign) Sets the horizontal alignment used when drawing text. Choose one of the following constants as values: <blockquote>fa_left fa_center fa_right </blockquote> draw_set_valign(valign) Sets the vertical alignment used when drawing text. Choose one of the following constants as values: <blockquote>fa_top fa_middle fa_bottom </blockquote> draw_text(x,y,string) Draws the string at position (x,y), using the drawing color and alpha. A # symbol or carriage return chr(13) or linefeed chr(10) are interpreted as newline characters. In this way you can draw multi-line texts. (Use \# to get the # symbol itself.) draw_text_ext(x,y,string,sep,w) Similar to the previous routine but you can specify two more things. First of all, sep indicates the separation distance between the lines of text in a multiline text. Use -1 to get the default distance. Use w to indicate the width of the text in pixels. Lines that are longer than this width are split- up at spaces or - signs. Use -1 to not split up lines. string_width(string) Width of the string in the current font as it would be drawn using the draw_text() function. Can be used for precisely positioning graphics. string_height(string) Height of the string in the current font as it would be drawn using the draw_text() function. string_width_ext(string,sep,w) Width of the string in the current font as it would be drawn using the draw_text_ext() function. Can be used for precisely positioning graphics. string_height_ext(string,sep,w) Height of the string in the current font as it would be drawn using the draw_text_ext() function. </blockquote> The following routines allow you to draw scaled and rotated text and also to use gradient colors on texts. These functions are only available in the Pro Edition! <blockquote>draw_text_transformed(x,y,string,xscale,yscale,angle) Draws the string at position (x,y) in the same way as above, but scale it horizontally and vertically with the indicated factors and rotate it counter-clockwise over angle degrees. draw_text_ext_transformed(x,y,string,sep,w,xscale,yscale,angle) Combines the function draw_text_ext and draw_text_transformed. It makes it possible to draw a multi-line text rotated and scaled. draw_text_color(x,y,string,c1,c2,c3,c4,alpha) Draws the string at position (x,y) like above. The four colors specify the colors of the top-left, top-right, bottom-right, and bottom-left corner of the text. alpha is the alpha transparency to be used (0-1). draw_text_ext_color(x,y,string,sep,w,c1,c2,c3,c4,alpha) Similar to draw_text_ext() but with colored vertices. draw_text_transformed_color(x,y,string,xscale,yscale,angle,c1,c2,c3,c4,alpha) Similar to draw_text_transformed() but with colored vertices. draw_text_ext_transformed_color(x,y,string,sep,w,xscale,yscale,angle,c1,c2,c3,c4,alpha) Similar to draw_text_ext_transformed() but with colored vertices. </blockquote>
plusdafont, un énorme site de ressources en polices d'écriture. http://www.dafont.com/fr/Quelque objets que j'ai fait auparavant permettant de drawer du texte sous différentes formes (lettres tombante,...) sa pourra te montrer l'utilisation des fonctions de manipulation du texte. |
|
zebdal Utilisateur confirmé: Rang *****
Messages : 2874 Localisation : Chez Vanilla Projet Actuel : Shrapnel
Kanon
Sengoku Rance Online
Vanilla H
| Sujet: Re: Besoin d'un cours sur les fonts et la police Ven 3 Juil 2009 - 23:30 | |
| xscale et yscale, c'est la longueur du texte ou alors le coefficient par lequel est multiplié la taille? |
|
Wargamer *Excellent utilisateur*
Messages : 6938 Projet Actuel : Bataille de cake au fruits
| Sujet: Re: Besoin d'un cours sur les fonts et la police Sam 4 Juil 2009 - 2:24 | |
| coefficien qui étire le texte comme une pate a biscuit sous un rouleau a pate :oui: _________________ Règle #1 du CBNA, ne pas chercher à faire dans la subtilité; personne comprend |
|
Wargamer *Excellent utilisateur*
Messages : 6938 Projet Actuel : Bataille de cake au fruits
| Sujet: Re: Besoin d'un cours sur les fonts et la police Sam 4 Juil 2009 - 13:29 | |
| j'ajoute qu'un coefficien de 2 est pas mal le max a faire pour garder un certain lissage sauf si on veux faire un jeux 8 bits =P _________________ Règle #1 du CBNA, ne pas chercher à faire dans la subtilité; personne comprend |
|
zebdal Utilisateur confirmé: Rang *****
Messages : 2874 Localisation : Chez Vanilla Projet Actuel : Shrapnel
Kanon
Sengoku Rance Online
Vanilla H
| Sujet: Re: Besoin d'un cours sur les fonts et la police Mer 8 Juil 2009 - 21:52 | |
| |
|