Ogłoszenie 

Uwaga! To forum jest w trybie offline.
Wszelką pomoc uzyskasz pod adresem
forum.ultimateam.pl


Administracja Forum


Poprzedni temat «» Następny temat
Zamknięty przez: Ayene
Nie 09 Sty, 2011 18:56
Long Text - Polskie znaki
Autor Wiadomość
Szymix 




Preferowany:
RPG Maker VX

Pomógł: 3 razy
Dołączył: 07 Paź 2010
Posty: 23
Skąd: Łomża
Wysłany: Sob 04 Gru, 2010 10:24
Long Text - Polskie znaki
Mam pewien problem - wgrałem skrypt Long Text Informational Window i wszystko działa, ale aby wyświetlał się tekst muszę go umieścić w folderze "Text". Tak też robię, ale nie pojawiają mi się polskie znaki - tam gdzie powinny być nic nie ma.
No i jeszcze sam skrypt:
- Temat na rpgmakervx.net
- Demo
- skrypt:
Spoiler:

#==============================================================================
# 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 => ["Skill Trees", "Text/skills.txt"],
2 => ["Party Rows", "Text/rows.txt"],
3 => ["Saving", "Text/saving.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 = false # Return to menu after exiting? false = return to map
MENU_INDEX = 5 # 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



Z góry dzięki za pomoc.
________________________

 
 
Agumon 




Preferowany:
RPG Maker VX

Ranga RM:
1 gra

Pomógł: 53 razy
Dołączył: 30 Gru 2009
Posty: 515
Skąd: Ruda Śląska
Wysłany: Nie 05 Gru, 2010 12:01
Może nie masz czcionki z polskimi znakami. Lepiej sprawdź bo ja tak samo miałem. Oczywiście bez skryptu.
________________________
Pomogłem? Daj ""
Piszę poprawnie po polsku

 
 
Wyświetl posty z ostatnich:   
Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi
Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Nie możesz załączać plików na tym forum
Możesz ściągać załączniki na tym forum
Dodaj temat do Ulubionych
Wersja do druku

Skocz do:  

Powered by phpBB modified by Przemo © 2003 phpBB Group | Template Klam by Ayene