AccueilAccueil  PortailPortail  RechercherRechercher  Dernières imagesDernières images  S'enregistrerS'enregistrer  ConnexionConnexion  



-40%
Le deal à ne pas rater :
Tefal Ingenio Emotion – Batterie de cuisine 10 pièces (induction, ...
59.99 € 99.99 €
Voir le deal

Partagez
 

 Problème de lettre sur ce script.

Voir le sujet précédent Voir le sujet suivant Aller en bas 
AuteurMessage
RitoJS
Modérateur
Modérateur
RitoJS


Masculin Age : 29
Inscrit le : 22/12/2011
Messages : 1600

Problème de lettre sur ce script. Empty
MessageSujet: Problème de lettre sur ce script.   Problème de lettre sur ce script. Icon_minitimeMer 14 Mar 2012 - 16:20

Bonjours.
Alors voilà, j'ai pris le script que voici:
Code:
==============================================================================
# Informational Long Text Scene
# by jfjohnny5
# 11/21/2010
#==============================================================================
# Creates a new scene for displaying long text fields to be used as tutorials,
# background story, or other informational material.
#
# The key to the "Long Text Window" is that the text content is loaded from
# external text files and can be of almost any length, as the script
# dynamically creates as many pages as are needed to display the content.
#
# Edit the COMMANDS list below to include the name for the given entry as well
# as the relative path to the .txt file containing the long text.
#
# You must include the following image file for the "more text" indicator:
#
# <project folder>\Graphics\Pictures\more_text.png
#
#------------------------------------------------------------------------------
# use the following script call to create the scene:
#
# $scene = Scene_Tutorial.new
#
#==============================================================================
$imported = {} if $imported == nil
$imported["TutorialScene"] = true

#==============================================================================
# CONFIGURATION
#==============================================================================

module TUT
 
  # Customize menu options and associated text files here. Be sure that any
  # additional selections follow the numbering convention (0,1,2,3,4,5,etc).
  # Text file path is relative to the main directory for the RPGM project.
  # The default configuration points to files in a "Text" subdirectory.
  COMMANDS = {
  #ID =>  [Command Name,            Text File]
  0  =>  ["Combat",        "Text/combat.txt"],
  1  =>  ["Grade",    "Text/skills.txt"],
  2  =>  ["Cuisine",      "Text/rows.txt"],
  3  =>  ["Soutient",        "Text/saving.txt"],
  4 =>  ["Affects",        "Text/Affects.txt"],
  5 =>  ["Quête",          "Text/Quête.txt"],
  6 =>  ["Eglise",        "Text/Eglise.txt"],
  }#Do Not Remove
 
  # The default text file to be loaded. This is also the text seen upon first
  # opening the window.
  DEFAULT = "Text/default.txt"
 
  RETURN_MENU = true # Return to menu after exiting? false = return to map
  MENU_INDEX = 7      # Menu slot to return to (only if above is true)
end
#==============================================================================
#----------------------------END CONFIGURATION---------------------------------
#==============================================================================


#==============================================================================
# Long Text Window
#==============================================================================

class Window_LongText < Window_Base
 
  attr_reader  :more_text
  #----------------------------------------------------------------------------
  # Initialize
  #----------------------------------------------------------------------------
  def initialize
    super(0, 0, Graphics.width*0.7, Graphics.height)
    @max_lines = (height-32)/WLH
    @more_text = false
    load_long_text
  end
  #----------------------------------------------------------------------------
  # Refresh
  #----------------------------------------------------------------------------
  def refresh
    self.contents.clear
    draw_long_text
  end
  #----------------------------------------------------------------------------
  # Update
  #----------------------------------------------------------------------------
  def update
    super
    update_icon
  end
  #----------------------------------------------------------------------------
  # Load Long Text
  #----------------------------------------------------------------------------
  def load_long_text(textFile=TUT::DEFAULT)
    file = File.open(textFile)
    text = ""
    @textArray = []
    while line = file.gets 
      text << line
    end
    text.gsub!("\n"," <%LINE_BREAK%> ")
    @textArray = text.split(" ")
    draw_long_text
  end
  #----------------------------------------------------------------------------
  # Draw Long Text
  #----------------------------------------------------------------------------
  def draw_long_text
    self.contents.clear
    y_off = 0
    drawArray = []
    tempArray = []
    lines_count = 0
    while !@textArray.empty? and lines_count < @max_lines-1
      loop do
        if @textArray.first == "<%LINE_BREAK%>"
          @textArray.shift
          break
        end
        tempArray.clear
        tempArray.replace(drawArray)
        tempArray << @textArray.first
        drawRect = self.contents.text_size(tempArray.join(" "))
        if drawRect.width < self.width-32
          drawArray << @textArray.shift
        else
          break
        end
      end
      self.contents.draw_text(x, y+y_off, width, WLH, drawArray.join(" "))
      drawArray.clear
      y_off += WLH
      lines_count += 1
    end
    if !@textArray.empty? and lines_count == @max_lines-1
      @more_text = true
      more_text_icon unless @icon_exists == true
    else
      @more_text = false
      if @icon_exists == true
        @icon.dispose
        @icon_exists = false
      end
    end
  end
  #----------------------------------------------------------------------------
  # More Text Icon
  #----------------------------------------------------------------------------
  def more_text_icon
    @icon = Sprite.new
    @icon.x = (self.width/2)-100
    @icon.y = Graphics.height-30
    @icon.z = 200
    @icon.bitmap = Bitmap.new("Graphics/Pictures/more_text.png")
    @icon_exists = true
  end
  #----------------------------------------------------------------------------
  # More Text Icon Update
  #----------------------------------------------------------------------------
  def update_icon
    if @icon_exists
      if @icon.opacity > 145 and @opacityDown == true
        @icon.opacity -= 5
      elsif @icon.opacity == 145
        @icon.opacity += 5
        @opacityDown = false
      end
      if @icon.opacity < 255 and @opacityDown == false
        @icon.opacity += 5
      elsif @icon.opacity == 255
        @icon.opacity -= 5
        @opacityDown = true
      end   
    end
  end     
end


#==============================================================================
# Tutorial Select Window
#==============================================================================

class Window_TutSelect < Window_Selectable
  #----------------------------------------------------------------------------
  # Initialize
  #----------------------------------------------------------------------------
  def initialize
    super(Graphics.width*0.7,0,Graphics.width*0.3,Graphics.height)
    @commands = TUT::COMMANDS
    @item_max = @commands.size
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0...@item_max
      draw_item(i)
    end
  end
  #--------------------------------------------------------------------------
  # Update
  #--------------------------------------------------------------------------
  def update
    super
    refresh
  end
  #--------------------------------------------------------------------------
  # Draw Item
  #--------------------------------------------------------------------------
  def draw_item(index, enabled = true)
    cmdArray = @commands[index]
    rect = item_rect(index)
    rect.x += 4
    rect.width -= 8
    self.contents.clear_rect(rect)
    if self.active
      self.contents.font.color = normal_color
    else
      self.contents.font.color = Color.new(160,160,160)
    end
    self.contents.font.color.alpha = enabled ? 255 : 128
    self.contents.draw_text(rect, cmdArray[0])
  end
end


#==============================================================================
# Tutorial Scene
#==============================================================================

class Scene_Tutorial < Scene_Base
  #----------------------------------------------------------------------------
  # Start
  #----------------------------------------------------------------------------
  def start
    super
    create_menu_background
    @long_text_window = Window_LongText.new
    @select_window = Window_TutSelect.new
    @select_window.active = true
  end
  #----------------------------------------------------------------------------
  # Update (Frame Update)
  #----------------------------------------------------------------------------
  def update
    super
    update_menu_background
    @long_text_window.update
    @select_window.update
    if @long_text_window.more_text == true
      @select_window.active = false
      @long_text_window.active = true
    else
      @select_window.active = true
      @long_text_window.active = false
    end
    if @select_window.active == true
      update_select_window
    elsif @long_text_window.active == true
      update_long_text_window
    end
  end
  #----------------------------------------------------------------------------
  # Update Select Window
  #----------------------------------------------------------------------------
  def update_select_window
    if Input.trigger?(Input::B)
      Sound.play_cancel
      if TUT::RETURN_MENU
        $scene = Scene_Menu.new(TUT::MENU_INDEX)
      else
        $scene = Scene_Map.new
      end
    elsif Input.trigger?(Input::C)
      Sound.play_decision
      cmdArray = TUT::COMMANDS[@select_window.index]
      @long_text_window.load_long_text(cmdArray[1])
    end
  end
  #----------------------------------------------------------------------------
  # Update Long Text Window
  #----------------------------------------------------------------------------
  def update_long_text_window
    if Input.trigger?(Input::C) or Input.trigger?(Input::B)
      Sound.play_decision
      @long_text_window.draw_long_text
    end
  end
  #----------------------------------------------------------------------------
  # Terminate
  #----------------------------------------------------------------------------
  def terminate
    super
    dispose_menu_background
    @long_text_window.dispose
    @select_window.dispose
  end
end
Il marche correctement sauf au niveau des écritures:
Spoiler:
Tout les rectangles sont des lettres avec un accent (à; é; ç; è, â...)
J'ai testé sur projet vierge et avec la police de base de RM et j'ai eu le même problème...
Donc voilà je demande de l'aide parce que je n'ai aucune idée d'où le problème peux venir.=(
Revenir en haut Aller en bas
http://lunarito.wordpress.com/
LightNox
Voyageur Lv.10
Voyageur Lv.10
LightNox


Masculin Age : 33
Inscrit le : 12/02/2009
Messages : 469

Problème de lettre sur ce script. Empty
MessageSujet: Re: Problème de lettre sur ce script.   Problème de lettre sur ce script. Icon_minitimeMer 14 Mar 2012 - 18:41

tout simplement enlève les accents ^^

" é " => " e " : " enlève " => " enleve "

et je pense que ton texte sera correct et sans avoir des carré de partout x)
Revenir en haut Aller en bas
RitoJS
Modérateur
Modérateur
RitoJS


Masculin Age : 29
Inscrit le : 22/12/2011
Messages : 1600

Problème de lettre sur ce script. Empty
MessageSujet: Re: Problème de lettre sur ce script.   Problème de lettre sur ce script. Icon_minitimeMer 14 Mar 2012 - 18:45

Oui je savais ^^'
Mais du coup se serait chiant à lire...surtout pour les"â"
Revenir en haut Aller en bas
http://lunarito.wordpress.com/
LightNox
Voyageur Lv.10
Voyageur Lv.10
LightNox


Masculin Age : 33
Inscrit le : 12/02/2009
Messages : 469

Problème de lettre sur ce script. Empty
MessageSujet: Re: Problème de lettre sur ce script.   Problème de lettre sur ce script. Icon_minitimeMer 14 Mar 2012 - 19:35

ouai mais... on va dire que si tu met par exemple "gateau" sans le "â" ce n'est pas grave on comprend quand même x)
Revenir en haut Aller en bas
Contenu sponsorisé




Problème de lettre sur ce script. Empty
MessageSujet: Re: Problème de lettre sur ce script.   Problème de lettre sur ce script. Icon_minitime

Revenir en haut Aller en bas
 

Problème de lettre sur ce script.

Voir le sujet précédent Voir le sujet suivant Revenir en haut 
Page 1 sur 1

 Sujets similaires

-
» demande de script lettre
» Problème de script.
» Problème script SBS 2.6 et 3.3
» Zombie Assault : Breath Of Chaos [PROBLEME DE SCRIPT ABBANDONS DU PROJET JUSQU'A NEW ABS SCRIPT]
» [Script] Recherche d'un problème face à la modification d'un script [Résolu]

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
RPG Maker VX :: Entraide :: Scripts :: Requêtes :: Archives-
Créer un forum | ©phpBB | Forum gratuit d'entraide | Signaler un abus | Forum gratuit