catskart Chevalier (niveau 1)
Messages postés : 79 Date d'inscription : 03/11/2013 Jauge LPC :
| Sujet: Donner de l'ombrage/contour noir à l'écriture. Jeu 3 Avr 2014 - 14:54 | |
| Salut, j'ai trouvé un script qui permet de donner de l'ombrage ou des contours noir aux lettres comme sur VX ou 2k3 L'auteur est Ultimate Jesus. Il faut mettre le script aux dessus de Main et Nommer "Bitmap.draw_text" Pour l'ombrage : - Code:
-
#=============================== # ■ Bitmap.draw_text #------------------------------------- # Aliases and redefines draw_text so that a shadow is drawn # Made by: Ultimate Jesus #======================================
class Bitmap
ShadowIndent = 1 # Size of the shadow (usually 1..3) ShadowColour = Color.new(0, 0, 0, 255)# the colour of the shadow # the 4th value is transparency (0-255) unless @ja_ta_feito == 1 # Fix for F12 Rebot by P@nCHo alias draw_text_plain draw_text @ja_ta_feito = 1 end def draw_text(arg1 = 0, arg2 = 0, arg3 = 0, arg4 = 0, arg5 = 0, arg6 = 0) if arg1.is_a?(Rect) x = arg1.x y = arg1.y width = arg1.width height = arg1.height string = arg2 align = arg3 else x = arg1 y = arg2 width = arg3 height = arg4 string = arg5 align = arg6 end colour = self.font.color.dup self.font.color = ShadowColour draw_text_plain(x + ShadowIndent, y + ShadowIndent, width, height, string, align) self.font.color = colour draw_text_plain(x, y, width, height, string, align) end end Et, pour vous faire cadeau, J'ai modifié ci-dessous le script pour donner les contours noirs aux lettres. - Code:
-
#=============================== # ■ Bitmap.draw_text #------------------------------------- # Aliases and redefines draw_text so that a shadow is drawn # Made by: Ultimate Jesus # Edited by Catskart #======================================
class Bitmap
ShadowIndent = 1 # Size of the shadow (usually 1..3) ShadowColour = Color.new(0, 0, 0, 255)# the colour of the shadow # the 4th value is transparency (0-255) unless @ja_ta_feito == 1 # Fix for F12 Rebot by P@nCHo alias draw_text_plain draw_text @ja_ta_feito = 1 end def draw_text(arg1 = 0, arg2 = 0, arg3 = 0, arg4 = 0, arg5 = 0, arg6 = 0) if arg1.is_a?(Rect) x = arg1.x y = arg1.y width = arg1.width height = arg1.height string = arg2 align = arg3 else x = arg1 y = arg2 width = arg3 height = arg4 string = arg5 align = arg6 end colour = self.font.color.dup self.font.color = ShadowColour draw_text_plain(x + ShadowIndent, y, width, height, string, align) draw_text_plain(x - ShadowIndent, y, width, height, string, align) draw_text_plain(x, y + ShadowIndent, width, height, string, align) draw_text_plain(x, y - ShadowIndent, width, height, string, align) self.font.color = colour draw_text_plain(x, y, width, height, string, align) end end Voici quelques screenshots : - Sans effet:
- Avec l'ombrage:
- Avec le contour noir:
|
|
trucbidule Modératrice
Messages postés : 1758 Date d'inscription : 28/04/2013 Jauge LPC :
| Sujet: Re: Donner de l'ombrage/contour noir à l'écriture. Jeu 3 Avr 2014 - 22:24 | |
| Merci du partage, je t'ajoute des points. |
|