Terror Rôdeur
Nombre de messages : 35 Date d'inscription : 16/05/2011
| Sujet: Problème police [résolu] Sam 11 Juin 2011, 21:06 | |
| Salut ! J'ai un problème dans mon projet rien ne s'écrit avant j'avais le morceau de script pour main mais je ne l'ais plus... Quelqu'un l'a pour moi ? s'il vous plait...
Dernière édition par Terror le Sam 11 Juin 2011, 21:53, édité 1 fois | |
|
Kiff57 Fou du Roi
Nombre de messages : 842 Age : 27 Projet(s) en cours : Dead Back Jeux Préférés : TLOZ Wind Waker Date d'inscription : 22/05/2010
| Sujet: Re: Problème police [résolu] Sam 11 Juin 2011, 21:16 | |
| Tiens, je te donne toute la portion de script de Main: - Code:
-
#============================================================================== # ** Main #------------------------------------------------------------------------------ # After defining each class, actual processing begins here. #==============================================================================
begin # Default Font Font.default_name = $fontface = "Arial" Font.default_size = $fontsize = 22 # Prepare for transition Graphics.freeze # Make scene object (title screen) $scene = Scene_Title.new # Call main method as long as $scene is effective while $scene != nil $scene.main end # Fade out Graphics.transition(20) rescue Errno::ENOENT # Supplement Errno::ENOENT exception # If unable to open file, display message and end filename = $!.message.sub("No such file or directory - ", "") print("Le ficher \"#{filename}\" n'a pas été trouvé.") end
| |
|
Terror Rôdeur
Nombre de messages : 35 Date d'inscription : 16/05/2011
| Sujet: Re: Problème police [résolu] Sam 11 Juin 2011, 21:53 | |
| Merci beaucoup toi tu est efficace ! ^^ Et tu ne dit pas que celui qui sais pas faire est un boulet (surtout pour ça ^^') | |
|
Nonos Fou du Roi
Nombre de messages : 850 Projet(s) en cours : Goblin-Valley, MMORPG par browser Jeux Préférés : Tactics Ogre, DQ, TES, BF, Fable, WoW, CS:Go, Red Orchestra Date d'inscription : 04/04/2009
| Sujet: Re: Problème police [résolu] Sam 11 Juin 2011, 22:25 | |
| Eh oui, Kiff est humble, contrairement à certains boulets des autres forums. D' ailleurs, c' est ce qui fait le charme du nôtre. Sinon, j' avais vu ton topic, mais j' avais pas trouvé le script. Auto-font install, de Wachunga? - Spoiler:
- Code:
-
#============================================================================== # ** Auto Font Install #------------------------------------------------------------------------------ # Wachunga # Version 1.0 # 2006-01-07 #------------------------------------------------------------------------------ =begin Automatically installs one or more fonts so the player doesn't have to. It only does this the first time the game is run and the process is quite transparent (notification to the player is optional). Thanks to MagicMagor for the pointer to one of the Win32 functions.
FEATURES - handles installation of fonts so players don't have to - supports multiple fonts - process is quite transparent
SETUP Create a Fonts folder in the game directory and place all fonts to be installed within. Then update the Filenames and Names constants below, adding an element to both arrays for each font. This just installs the fonts. You'll still have to refer to them as necessary, e.g. setting a new default as follows (in main): Font.default_name = [Fonts::Names[0], 'MS PGothic']
This script can run with the SDK available from: http://www.rmxp.net/forums/index.php?&showtopic=31096 Note: if player does not have the rights to install fonts on their machine, this probably won't work -- but then they wouldn't be able to do it manually either. :) #------------------------------------------------------------------------------ =end
#------------------------------------------------------------------------------ # * SDK Log Script #------------------------------------------------------------------------------ if Object.constants.include?(:SDK) SDK.log('Auto Font Install', 'Wachunga', 1.0, '2006-01-07') end #------------------------------------------------------------------------------ # Begin SDK Enabled Check #------------------------------------------------------------------------------ if !Object.constants.include?(:SDK) or SDK.state('Auto Font Install') #-------------------------------------------------------- module Fonts # filenames of fonts to be in stalled Filenames = ['dinstik.ttf'] # e.g. Filenames = ['carbono_pw.ttf','FUTRFW.TTF'] # names (not filenames) of fonts to be installed Names = ['dinstik'] # e.g. Names = ['carbono', 'Futurist Fixed-width'] # whether to notify player (via pop-up message) that fonts were installed Notify = true # location of fonts (relative to game folder) Source = 'Fonts/' # location of fonts after installation Dest = ENV['SystemRoot'] + 'Fonts\' end #-------------------------------------------------------- class Scene_Title #------------------------------------------------- AFR = Win32API.new('gdi32', 'AddFontResource', ['P'], 'L') WPS = Win32API.new('kernel32', 'WriteProfileString', ['P'] * 3, 'L') SM = Win32API.new('user32', 'SendMessage', ['L'] * 4, 'L') WM_FONTCHANGE = 0x001D HWND_BROADCAST = 0xffff #------------------------------------------------- alias wachunga_autofontinstall_st_main main def main success = [] for i in 0...Fonts::Filenames.size f = Fonts::Filenames[i] # check if already installed... if not FileTest.exists?(Fonts::Dest + f) # check to ensure font is in specified location... if FileTest.exists?(Fonts::Source + f) # move file to fonts folder File.rename(Fonts::Source + f, Fonts::Dest + f) # add font resource AFR.call(Fonts::Dest + f) # add entry to win.ini/registry WPS.call('Fonts', Fonts::Names[i] + ' (TrueType)', f) SM.call(HWND_BROADCAST,WM_FONTCHANGE,0,0) if FileTest.exists?(Fonts::Dest + f) success.push(Fonts::Names[i]) else p 'Auto Font Install: failed to install' + Fonts::Names[i] + '.' end else p 'Auto Font Install: font ' + f + ' not found.' end end end if success != [] # one or more fonts successfully installed if Fonts::Notify fonts = '' success.each do |f| fonts << f << ', ' end p 'Auto Font Install: sucessfully installed ' + fonts[0..-3] end # new fonts aren't recognized in RMXP until the program is # restarted, so this is (unfortunately) necessary a = Thread.new { system('Game') } exit end wachunga_autofontinstall_st_main end #------------------------------------------------- end #-------------------------------------------------------- end #------------------------------------------------------------------------------ # End SDK Enabled Test #------------------------------------------------------------------------------
Il permet d' installer directement les polices dans le dossier Fonts de l' utilisateur sans intervention manuelle. Utilisation: Placer les polices dans le dossier Fonts/ Lignes 50-53 - Code:
-
Filenames = ['carbono_pw.ttf','FUTRFW.TTF'] .... Names = ['carbono', 'Futurist Fixed-width']
Première ligne: Fichier de la police avec l' extension (Ici, le .ttf) Seconde ligne: Le nom de la police en elle-même. | |
|
Kiff57 Fou du Roi
Nombre de messages : 842 Age : 27 Projet(s) en cours : Dead Back Jeux Préférés : TLOZ Wind Waker Date d'inscription : 22/05/2010
| |
Contenu sponsorisé
| Sujet: Re: Problème police [résolu] | |
| |
|