Quest_log problem
Aktualny czas: 26-05-26, 06:11 Witaj! Przejdź do zakładki Logowanie lub Rejestracja


Wątek zamknięty 
[XP] Quest_log problem
M4t3us2 Offline
*


Liczba postów: 38
Dołączył: 03-05-13

Pomógł: 0



Post: #6
RE: Quest_log problem

To ty poprostu skopiowałeś sam ten skrypt?? on wymaga jeszcze 2 rzeczy
=begin

ATP(Advanced Text Paragrapher) V1.0 by Samo, The thief

Ok, Something of The Scripters do normally to draw a text in form of a paragraph is
doing an array [] that contains each line. The Time Has come For
This Microsoft Word Effect!
This Script Just need a Long String and it will paragraph it!

How to call it?

paragraph = str_paragraph(string, width of the paragraph.)

Example :

@my_paragraph = str_paragraph("La la la la la la la la la , This is a Looooong Strriiiing!", 120)


Returns an Array with each line separately.

How to draw it?

draw_paragraph(x,y,width,height, paragraph)

width and height for each line, not for the paragraph.

.::-NOTE-::.

If you put a ' ^ '(must be between spaces), the text will pass to the next line.
This Symbol Won't be drawed.

Reminder: Always use '' instead of ""! It works faster!

=end


class Window_Base < Window
#--------------------------------------------------
  def str_paragraph(str_old, width)
    temp_str = ''
    str = '' + str_old
    words = []
    size = 0
    str_size = 0
    #
    while ((c = str.slice!(/./m)) != nil)
      temp_str += c
      str_size += 1
      if c == ' '
        words.push(temp_str)
        temp_str = ''
      end
      if str.size == 0
        words.push(temp_str)
        temp_str = ''
      end
    end
    lines = []
    for i in 0...words.size
      word = words[i]
      if word == '^ '
        lines.push(temp_str)
        temp_str = ''
        next
      end
      temp_str += word
      size = contents.text_size(temp_str).width
      if size > width - contents.text_size(' ').width
        for i in 1..word.size
          temp_str = temp_str.chop
        end
        lines.push(temp_str)
        temp_str = ''
        temp_str += word
      end
    end
    words = words.compact
    if temp_str != ''
      lines.push(temp_str)
    end
    return lines
  end
#---------------------------------------------------------------------
  def draw_paragraph(x,y,width,height,lines,align = 0)
    for i in 0...lines.size
      self.contents.draw_text(x, y + i * self.contents.font.size + 1, width, height, lines[i], align)
    end
  end
#-----------------------------------------------------------------
end

oraz zrób nową rubryke nad skryptem o nazwie data_quest(chyba, że już to masz) i tam wpisujesz te $quest= ["nazwa", poziom, "grafika", "treść"]

i wyluzuj troche, pisałem "możliwe" więc sam nie byłem tego pewien bo na skrytptach się nie znam a zasugerowałem się słowem obrazek.
(Ten post był ostatnio modyfikowany: 15-09-13 15:12 przez M4t3us2.)
15-09-13 15:10
Znajdź wszystkie posty użytkownika
"Pomógł" przyznał(a):
Wątek zamknięty 


Wiadomości w tym wątku
Quest_log problem - Xovr - 15-09-13, 13:05
RE: Quest_log problem - M4t3us2 - 15-09-13, 14:23
RE: Quest_log problem - Xovr - 15-09-13, 14:33
RE: Quest_log problem - M4t3us2 - 15-09-13, 14:41
RE: Quest_log problem - Xovr - 15-09-13, 14:51
RE: Quest_log problem - M4t3us2 - 15-09-13 15:10
RE: Quest_log problem - Xovr - 15-09-13, 15:20
RE: Quest_log problem - M4t3us2 - 15-09-13, 15:58
RE: Quest_log problem - Xovr - 15-09-13, 16:04
RE: Quest_log problem - Ayene - 15-09-13, 19:08
RE: Quest_log problem - Xovr - 15-09-13, 20:23

Skocz do:


Użytkownicy przeglądający ten wątek: 1 gości

Kontakt | Ultima Forum | Wróć do góry | Wróć do forów | Wersja bez grafiki | RSS
Powered By MyBB. © 2013 MyBB Group. All Rights Reserved.
Skórka by Ayene.