Czcionka z RM2k
Aktualny czas: 28-04-26, 12:11 Witaj! Przejdź do zakładki Logowanie lub Rejestracja


Odpowiedz 
[XP] Czcionka z RM2k
Ayene Offline
*


Liczba postów: 758
Dołączył: 09-04-13

Pomógł: 112



Post: #1
Czcionka z RM2k

~ RM2k Font in RMXP ~


Krótki opis:
Skrypt wyświetla napisy w grze w stylu z RMk2.
Walorem skryptu jest brak dodatkowych grafik i czcionek.
Minusem z kolei jest brak możliwości zmiany wielkości czcionki i stylu (kursywa, pogrubienie).

Nie dodałam wszystkich znaków specjalnych, więc w razie czego piszcie w tym temacie. Uzupełnię braki.

Autor:
Ayene

Skrypt:
Spoiler: (Otwórz)
Screeny:
Spoiler: (Otwórz)
Dodatkowe informacje:
Aby czcionka była wyświetlana poprawnie w oknie wiadomości, należy wejść w skrypt "Window_Message" i linijkę (ok. 146):
x += self.contents.text_size(c).width
zamienić na:
x += self.contents.letter_width

[Obrazek: aye_furniture_pres.png]
04-01-15 01:41
Znajdź wszystkie posty użytkownika Odpowiedz cytując ten post
"Pomógł" przyznał(a):
kanumerki Offline
*


Liczba postów: 247
Dołączył: 02-05-13

Pomógł: 45



Post: #2
RE: Czcionka z RM2k

Kawał dobrej roboty, wiedząc że każdą literkę stworzyłaś osobno rysując za pomocą prostokątów :D

Drugie to że skrypt można z łatwością przekonwertować aby działał na Vx Ace.
Wystarczy zmienić linijkę:
text = sprintf(text)
na:
text = sprintf(text.to_s)
i działa, choć problematycznie literki nie mieszczą się w kolumnach. Najbardziej w Menu. Przydatne jak ktoś nie cierpi XP, a pracuje ja VXace ;d

Stary nick:ka0909
Pomagam w przerabianiu lekkich skryptów smiles
04-01-15 02:14
Znajdź wszystkie posty użytkownika Odpowiedz cytując ten post
"Pomógł" przyznał(a):
Dragon Kamillo Offline
*


Liczba postów: 330
Dołączył: 28-04-13

Pomógł: 24



Post: #3
RE: Czcionka z RM2k

To mi się podoba, również cieszę się z możliwości użycia tego w ACE - przynajmniej nic cie tracę gdybym chciał coś w nim zrobić (tak mapki da się przenosić z XP XD).

Boli tylko brak możliwości zmiany czcionki (choć to chyba da się jakoś dorobić), a bardziej boli brak gradientowego kolorowania. Ale za to cień jest fajny.

Chociaż jak tak myślę to skoro i tak rysujemy oddzielnie każdą kreseczkę - to może możemy też każdą inaczej pokolorować? Oczywiście problem pojawiłby się gdybyśmy chcieli zmienić kolor, albo użyć kilku kolorów w jednej wiadomości, ale myślę, że i to dało by się jakoś rozwiązać.

Najprostszym rozwiązaniem jakie przychodzi mi na myśl to skorzystanie z poleceń tekstowych "\", i oddzielnych wzorów na rysowanie literek, ale to by było kupe roboty i skrypt zrobiłby się baaardzo długi.
24-01-15 01:09
Znajdź wszystkie posty użytkownika Odpowiedz cytując ten post
"Pomógł" przyznał(a):
Ayene Offline
*


Liczba postów: 758
Dołączył: 09-04-13

Pomógł: 112



Post: #4
RE: Czcionka z RM2k

Gradientowe kolorowanie... W Ace'ie używanie "rysowanych" czcionek nieco mija się z celem. Przecież wystarczy nową wrzucić do folderu Fonts...
Niemniej jeśli kogoś interesuje rozwiązanie... myślę, że można zmienić schemat rysowania na odwrotny. Wystarczy narysować gradientowy prostokąt i usuwać kolejno piksele (clear_rect) tak, aby otrzymać określoną literę. Gradient można uzyskać poprzez sparowanie odpowiednich kolorów w Window.png. Ktoś w ogóle byłby zainteresowany podobnym "bajerem"? W innym razie szkoda zachodu dla innych wersji niż XP.

[Obrazek: aye_furniture_pres.png]
03-02-15 23:11
Znajdź wszystkie posty użytkownika Odpowiedz cytując ten post
"Pomógł" przyznał(a):
Dragon Kamillo Offline
*


Liczba postów: 330
Dołączył: 28-04-13

Pomógł: 24



Post: #5
RE: Czcionka z RM2k

A Ace obsługuję format bitmap dla fontów, testowałem tylko w XP i on tego nie obsługiwał? A przepisywanie do TrueType jest trochę męczące (prawdopodobniej bardziej niż napisanie wzoru na rysowanie paru prostokątów) i nie daje nam równej szerokości każdej litery - przez co to już nie wygląda tak jak powinno.

A co do Gradientu, to może trochę źle piszę, bo same skrypty na gradientowe kolorowanie są już i dla XP i dla innych makerów, ale co z tego skoro one wszystkie opierają się na schemacie - podaj wartość barwy górnej i dolnej, a reszta się zrobi automatycznie. A o to mi nie chodzi bo to bez sensu, w dodatku powoduje nieraz dziwne rzeczy, więc jeśli myślisz o czymś takim - daj sobie spokój.

W RM2k dzieje się inaczej, tam kolor czcionki jest określany w grafice systemu. Daje to większe możliwości niż podstawa w nowszych makerach, gdzie kolor jest zapisany na STAŁE (wiem można to zmieniać, dodawać nowe, ale jak ktoś nowy w RM ma o tym wiedzieć?) w RGSS. W 2k możesz sam sobie narysować jak chcesz (jednolity kolor, gradient z góry na dół, z lewej na prawo, z rogu, inny wariant) i to jest genialne. Może do nowszych makerów też dałoby się coś takiego zrobić? Przykład - czegoś takiego już normalnym skryptem na gradient w RM nie da się zrobić http://tsukuru.pl/zasoby/2ksystem/ciemny...system.png (dolne dwa wiersze to kolory czcionek)

W dodatku w RM2k jest lepsza obsługa samego tła systemu, w RMXP w górę może być tylko rozciągany (co wygląda ohydnie i jest zresztą wypisywane jako jeden z minusów makera), a w RM2k oprócz rozciągania mamy jeszcze zapętlanie - co już jest OK. Częściowo da się to rozwiązać w RMVX przez obrazek, zresztą w RMXP też, ale nadal zostaje to w menu czy podczas walki...

EDIT: zauważyłem że na zrzucie w pierwszym poście tło jest zapętlane a nie rozciągane, masz na to skrypt, czy po prostu to sprytny obrazek zamiast systemu?
(Ten post był ostatnio modyfikowany: 04-02-15 15:29 przez Dragon Kamillo.)
04-02-15 15:25
Znajdź wszystkie posty użytkownika Odpowiedz cytując ten post
"Pomógł" przyznał(a):
Ayene Offline
*


Liczba postów: 758
Dołączył: 09-04-13

Pomógł: 112



Post: #6
RE: Czcionka z RM2k

Myślę, że można opracować system zmienionego windowskina. Można spokojnie zapętlić tło (mam taki skrypt) i dodać kolory czytane z "grafiki systemu". Pewnie dałoby radę również wprowadzić gradient podobnie do wrzuconego przez Ciebie pliku... Możemy zrobić test, jeśli masz ochotę. Daj windowskin, który chciałbyś zapętlić, a ja zmodyfikuję domyślną klasę Window.

No i takie pytanie... Czy byłby ktoś zainteresowany podobnym skryptem jak w temacie, jednak opartym na wczytywaniu liter z bitmapy?

[Obrazek: aye_furniture_pres.png]
04-02-15 22:25
Znajdź wszystkie posty użytkownika Odpowiedz cytując ten post
"Pomógł" przyznał(a):
Dragon Kamillo Offline
*


Liczba postów: 330
Dołączył: 28-04-13

Pomógł: 24



Post: #7
RE: Czcionka z RM2k

No to dla przykładu system z projektu Asgaroth:
2k3: http://i.imgur.com/eSfF8PH.png
szybka przeróbka do XP: http://i.imgur.com/tUCS0dh.png
05-02-15 00:17
Znajdź wszystkie posty użytkownika Odpowiedz cytując ten post
"Pomógł" przyznał(a):
Ayene Offline
*


Liczba postów: 758
Dołączył: 09-04-13

Pomógł: 112



Post: #8
RE: Czcionka z RM2k

Użyłam nieco innej skórki, by zróżnicować rogi. Oto wynik moich zmagań:
[Obrazek: custom_window_screen.jpg]
Zmodyfikowałam kształt windowskina, by można było czytać z niego kolor czcionki i gradientu. Do tego zmniejszyłam tło, aby ładnie wyglądały rogi. Oczywiście można wrócić do starej wersji. No i kolorów można dodać więcej (wystarczy jeden piksel koloru i jeden piksel gradientu), więc można by umieścić ich ponad 2000... tylko po co :P
Tak wygląda okienko:
[Obrazek: custom_window.png]

A to dość długi kod:
#==============================================================================
# CUSTOM WINDOWSKIN by Ayene
#   Zapętlanie tła w oknie
#   Gradient czcionki
#   Czcionka RM2k
#   Kolor czytany z windowskina
#
# Wykorzystano skrypt "Window - Hidden RGSS Class" by Selwyn
#==============================================================================

module CustomWindow
  STRETCH = false       # Rozciąganie tła okna
  GRADIENT = true       # Gradient czcionki
  BITMAP_FONT = false   # Czcionka RM2k
  SHADOW = true         # Cień
end
  
#==============================================================================
# Color
#==============================================================================
class Color  
  #--------------------------------------------------------------------------
  # * Gradient
  #--------------------------------------------------------------------------
  def gradient
    @gradient = self if @gradient.nil?
    return @gradient
  end
  #--------------------------------------------------------------------------
  # * Gradient=
  #--------------------------------------------------------------------------
  def gradient=(gradient)
    @gradient = gradient
  end
end

#==============================================================================
# Window
#==============================================================================
class Window
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader   :x
  attr_reader   :y
  attr_reader   :z
  attr_reader   :width
  attr_reader   :height
  attr_reader   :ox
  attr_reader   :oy
  attr_reader   :opacity
  attr_reader   :back_opacity
  attr_reader   :stretch
  attr_reader   :contents_opacity
  attr_reader   :visible
  attr_reader   :pause
  attr_accessor :active
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize()
    @skin = Skin.new
    @viewport = Viewport.new(0, 0, 0, 0)
    @cursor_viewport = Viewport.new(0, 0, 0, 0)
    @width = 0
    @height = 0
    @ox = 0
    @oy = 0
    @opacity = 255
    @back_opacity = 255
    @contents_opacity = 255
    @frame   = Sprite.new()
    @bg      = Sprite.new()
    @window  = Sprite.new(@viewport)
    @pause_s = Sprite.new()
    @arrows = []
    for i in 0...4
      @arrows.push(Sprite.new(@cursor_viewport))
      @arrows[i].bitmap = Bitmap.new(16, 16)
      @arrows[i].visible = false
    end
    @cursor_rect = Cursor_Rect.new(@cursor_viewport)
    @cursor_fade = true
    @pause_s.visible = false
    @pause = false
    @active = true
    @stretch = CustomWindow::STRETCH
    @visible = true
    self.x = 0
    self.y = 0
    self.z = 100
    self.windowskin = RPG::Cache.windowskin($game_system.windowskin_name)
  end
  #--------------------------------------------------------------------------
  # * Contents
  #--------------------------------------------------------------------------
  def contents=(bmp)
    @window.bitmap = bmp
    if bmp != nil
      if bmp.width > @viewport.rect.width
        bmp.height > @viewport.rect.height
        draw_arrows
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Contents
  #--------------------------------------------------------------------------
  def contents
    return @window.bitmap
  end
  #--------------------------------------------------------------------------
  # * Dispose
  #--------------------------------------------------------------------------
  def dispose
    @bg.dispose
    @frame.dispose
    @window.dispose
    @cursor_rect.dispose
    @viewport.dispose
    @pause_s.dispose
    @cursor_viewport.dispose
    for arrow in @arrows
      arrow.dispose
    end
  end
  #--------------------------------------------------------------------------
  # * Update
  #--------------------------------------------------------------------------
  def update
    @window.update
    @cursor_rect.update
    @viewport.update
    @cursor_viewport.update
    @pause_s.src_rect = @skin["pause#{(Graphics.frame_count / 8) % 4}"]
    @pause_s.update
    update_visible
    update_arrows
    if @cursor_fade
      @cursor_rect.opacity -= 10
      @cursor_fade = false if @cursor_rect.opacity <= 100
    else
      @cursor_rect.opacity += 10
      @cursor_fade = true if @cursor_rect.opacity >= 255
    end
  end
  #--------------------------------------------------------------------------
  # * Update Visible
  #--------------------------------------------------------------------------
  def update_visible
    @frame.visible = @visible
    @bg.visible = @visible
    @window.visible = @visible
    @cursor_rect.visible = @visible
    if @pause
      @pause_s.visible = @visible
    else
      @pause_s.visible = false
    end
  end
  #--------------------------------------------------------------------------
  # * Pause
  #--------------------------------------------------------------------------
  def pause=(pause)
    @pause = pause
    update_visible
  end
  #--------------------------------------------------------------------------
  # * Update Arrows
  #--------------------------------------------------------------------------
  def update_arrows
    if @window.bitmap == nil or @visible == false
      for arrow in @arrows
        arrow.visible = false
      end
    else
      @arrows[0].visible = @oy > 0
      @arrows[1].visible = @ox > 0
      @arrows[2].visible = (@window.bitmap.width - @ox) > @viewport.rect.width
      @arrows[3].visible = (@window.bitmap.height - @oy) > @viewport.rect.height
    end
  end
  #--------------------------------------------------------------------------
  # * Visible
  #--------------------------------------------------------------------------
  def visible=(visible)
    @visible = visible
    update_visible
    update_arrows
  end
  #--------------------------------------------------------------------------
  # * X-coordinate
  #--------------------------------------------------------------------------
  def x=(x)
    @x = x
    @bg.x = x + 2
    @frame.x = x
    @viewport.rect.x = x + 16
    @cursor_viewport.rect.x = x
    @pause_s.x = x + (@width / 2) - 8
    set_arrows
  end
  #--------------------------------------------------------------------------
  # * Y-coordinate
  #--------------------------------------------------------------------------
  def y=(y)
    @y = y
    @bg.y = y + 2
    @frame.y = y
    @viewport.rect.y = y + 16
    @cursor_viewport.rect.y = y
    @pause_s.y = y + @height - 16
    set_arrows
  end
  #--------------------------------------------------------------------------
  # * Z-coordinate
  #--------------------------------------------------------------------------
  def z=(z)
    @z = z
    @bg.z = z
    @frame.z = z + 1
    @cursor_viewport.z = z + 2
    @viewport.z = z + 3
    @pause_s.z = z + 4
  end
  #--------------------------------------------------------------------------
  # * OX
  #--------------------------------------------------------------------------
  def ox=(ox)
    return if @ox == ox
    @ox = ox
    @viewport.ox = ox
    update_arrows
  end
  #--------------------------------------------------------------------------
  # * OY
  #--------------------------------------------------------------------------
  def oy=(oy)
    return if @oy == oy
    @oy = oy
    @viewport.oy = oy
    update_arrows
  end
  #--------------------------------------------------------------------------
  # * Width
  #--------------------------------------------------------------------------
  def width=(width)
    @width = width
    @viewport.rect.width = width - 16 * 2
    @cursor_viewport.rect.width = width
    if @width > 0 and @height > 0
      @frame.bitmap = Bitmap.new(@width, @height)
      @bg.bitmap = Bitmap.new(@width - 4, @height - 4)
      draw_window
    end
    self.x = @x
    self.y = @y
  end
  #--------------------------------------------------------------------------
  # * Height
  #--------------------------------------------------------------------------
  def height=(height)
    @height = height
    @viewport.rect.height = height - 16 * 2
    @cursor_viewport.rect.height = height
    if @height > 0 and @width > 0
      @frame.bitmap = Bitmap.new(@width, @height)
      @bg.bitmap = Bitmap.new(@width - 4, @height - 4)
      draw_window
    end
    self.x = @x
    self.y = @y
  end
  #--------------------------------------------------------------------------
  # * Opacity
  #--------------------------------------------------------------------------
  def opacity=(opacity)
    value = [[opacity, 255].min, 0].max
    @opacity = value
    @contents_opacity = value
    @back_opacity = value
    @frame.opacity = value
    @bg.opacity = value
    @window.opacity = value
  end
  #--------------------------------------------------------------------------
  # * Back Opacity
  #--------------------------------------------------------------------------
  def back_opacity=(opacity)
    value = [[opacity, 255].min, 0].max
    @back_opacity = value
    @bg.opacity = value
  end
  #--------------------------------------------------------------------------
  # * Contents Opacity
  #--------------------------------------------------------------------------
  def contents_opacity=(opacity)
    value = [[opacity, 255].min, 0].max
    @contents_opacity = value
    @window.opacity = value
  end
  #--------------------------------------------------------------------------
  # * Cursor Rectangle
  #--------------------------------------------------------------------------
  def cursor_rect
    return @cursor_rect
  end
  #--------------------------------------------------------------------------
  # * Cursor Rectangle=
  #--------------------------------------------------------------------------
  def cursor_rect=(rect)
    @cursor_rect.x = rect.x
    @cursor_rect.y = rect.y
    if @cursor_rect.width != rect.width or @cursor_rect.height != rect.height
      @cursor_rect.set(@cursor_rect.x, @cursor_rect.y, rect.width, rect.height)
    end
  end
  #--------------------------------------------------------------------------
  # * Windowskin
  #--------------------------------------------------------------------------
  def windowskin
    return @skin.bitmap
  end
  #--------------------------------------------------------------------------
  # * Windowskin=
  #--------------------------------------------------------------------------
  def windowskin=(windowskin)
    return if windowskin == nil
    if @skin.bitmap != windowskin
      @pause_s.bitmap = windowskin
      @pause_s.src_rect = @skin['pause0']
      @skin.bitmap = windowskin
      @cursor_rect.skin = windowskin
      draw_window
      draw_arrows
    end
  end
  #--------------------------------------------------------------------------
  # * Stretch=
  #--------------------------------------------------------------------------
  def stretch=(bool)
    if @stretch != bool
      @stretch = bool
      draw_window
    end
  end
  #--------------------------------------------------------------------------
  # * Set Arrow
  #--------------------------------------------------------------------------
  def set_arrows
    @arrows[0].x = @width / 2 - 8
    @arrows[0].y = 8
    @arrows[1].x = 8
    @arrows[1].y = @height / 2 - 8
    @arrows[2].x = @width - 16
    @arrows[2].y = @height / 2 - 8
    @arrows[3].x = @width / 2 - 8
    @arrows[3].y = @height - 16
  end
  #--------------------------------------------------------------------------
  # * Draw Arrow
  #--------------------------------------------------------------------------
  def draw_arrows
    return if @skin.bitmap == nil
    @arrows[0].bitmap.blt(0, 0, @skin.bitmap, @skin['arrow_up'])
    @arrows[1].bitmap.blt(0, 0, @skin.bitmap, @skin['arrow_left'])
    @arrows[2].bitmap.blt(0, 0, @skin.bitmap, @skin['arrow_right'])
    @arrows[3].bitmap.blt(0, 0, @skin.bitmap, @skin['arrow_down'])
    update_arrows
  end
  #--------------------------------------------------------------------------
  # * Draw Window
  #--------------------------------------------------------------------------
  def draw_window
    return if @skin.bitmap == nil
    return if @width == 0 or @height == 0
    if @frame.bitmap.nil?
      @frame.bitmap = Bitmap.new(@width, @height)
      @bg.bitmap = Bitmap.new(@width - 4, @height - 4)
    end
    @frame.bitmap.clear
    @bg.bitmap.clear
    if @stretch
      dest_rect = Rect.new(0, 0, @width-4, @height-4)
      @bg.bitmap.stretch_blt(dest_rect, @skin.bitmap, @skin['bg'])
    else
      bgw = Integer((@width-4) / 32) + 1
      bgh = Integer((@height-4) / 32) + 1    
      for x in 0..bgw
        for y in 0..bgh
          @bg.bitmap.blt(x * 32, y * 32, @skin.bitmap, @skin['bg'])
        end
      end
      for x in 0..bgw
        @bg.bitmap.blt(x * 32, 0, @skin.bitmap, @skin['bg_up'])
        @bg.bitmap.blt(x * 32, @height - 20, @skin.bitmap, @skin['bg_down'])
      end
      for y in 0..bgh
        @bg.bitmap.blt(0, y * 32, @skin.bitmap, @skin['bg_left'])
        @bg.bitmap.blt(@width -20, y * 32, @skin.bitmap, @skin['bg_right'])
      end  
      @bg.bitmap.blt(0, 0, @skin.bitmap, @skin['bg_ulcorner'])
      @bg.bitmap.blt(@width - 20, 0, @skin.bitmap, @skin['bg_urcorner'])
      @bg.bitmap.blt(0, @height - 20, @skin.bitmap, @skin['bg_dlcorner'])
      @bg.bitmap.blt(@width - 20, @height - 20, @skin.bitmap, @skin['bg_drcorner'])
    end
    bx = Integer((@width - 32) / @skin['up'].width) + 1
    by = Integer((@height - 32) / @skin['left'].height) + 1
    for x in 0..bx
      w = @skin['up'].width
      @frame.bitmap.blt(x * w + 16, 0, @skin.bitmap, @skin['up'])
      @frame.bitmap.blt(x * w + 16, @height - 16, @skin.bitmap, @skin['down'])
    end
    for y in 0..by
      h = @skin['left'].height
      @frame.bitmap.blt(0, y * h + 16, @skin.bitmap, @skin['left'])
      @frame.bitmap.blt(@width - 16, y * h + 16, @skin.bitmap, @skin['right'])
    end
    @frame.bitmap.erase(@width - 16, 0, 16, 16)
    @frame.bitmap.erase(0, @height - 16, 16, 16)
    @frame.bitmap.erase(@width - 16, @height - 16, 16, 16)
    @frame.bitmap.blt(0, 0, @skin.bitmap, @skin['ul_corner'])
    @frame.bitmap.blt(@width - 16, 0, @skin.bitmap, @skin['ur_corner'])
    @frame.bitmap.blt(0, @height - 16, @skin.bitmap, @skin['dl_corner'])
    @frame.bitmap.blt(@width - 16, @height - 16, @skin.bitmap, @skin['dr_corner'])
  end
end

#==============================================================================
# Skin
#==============================================================================
class Skin
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :bitmap
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    @bitmap = nil
    @values = {}
    @values['bg'] = Rect.new(16, 16, 32, 32)
    @values['bg_ulcorner'] = Rect.new(0, 0, 16, 16)
    @values['bg_urcorner'] = Rect.new(48, 0, 16, 16)
    @values['bg_dlcorner'] = Rect.new(0, 48, 16, 16)
    @values['bg_drcorner'] = Rect.new(48, 48, 16, 16)
    @values['bg_up'] = Rect.new(16, 0, 32, 16)
    @values['bg_down'] = Rect.new(16, 48, 32, 16)
    @values['bg_left'] = Rect.new(0, 16, 16, 32)
    @values['bg_right'] = Rect.new(48, 16, 16, 32)
    @values['pause0'] = Rect.new(96, 64, 16, 16)
    @values['pause1'] = Rect.new(112, 64, 16, 16)
    @values['pause2'] = Rect.new(96, 80, 16, 16)
    @values['pause3'] = Rect.new(112, 80, 16, 16)  
    @values['arrow_up'] = Rect.new(88, 16, 16, 8)
    @values['arrow_down'] = Rect.new(88, 40, 16, 8)
    @values['arrow_left'] = Rect.new(80, 24, 8, 16)
    @values['arrow_right'] = Rect.new(104, 24, 8, 16)  
    @values['ul_corner'] = Rect.new(64, 0, 16, 16)
    @values['ur_corner'] = Rect.new(112, 0, 16, 16)
    @values['dl_corner'] = Rect.new(64, 48, 16, 16)
    @values['dr_corner'] = Rect.new(112, 48, 16, 16)
    @values['up'] = Rect.new(80, 0, 32, 16)
    @values['down'] = Rect.new(80, 48, 32, 16)
    @values['left'] = Rect.new(64, 16, 16, 32)
    @values['right'] = Rect.new(112, 16, 16, 32)
  end
  #--------------------------------------------------------------------------
  # []
  #--------------------------------------------------------------------------
  def [](value)
    return @values[value]
  end
end

#==============================================================================
# Cursor_Rect
#==============================================================================
class Cursor_Rect < ::Sprite
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader   :height
  attr_reader   :width
  attr_reader   :skin
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(viewport)
    super(viewport)
    @width = 0
    @height = 0
    @skin = nil
    @rect = {}
    @rect['bg'] = Rect.new(65, 65, 30, 30)
    @rect['cursor_up'] = Rect.new(65, 64, 30, 1)
    @rect['cursor_down'] = Rect.new(65, 95, 30, 1)
    @rect['cursor_left'] = Rect.new(64, 65, 1, 30)
    @rect['cursor_right'] = Rect.new(95, 65, 1, 30)
    @rect['upleft'] = Rect.new(64, 64, 1, 1)
    @rect['upright'] = Rect.new(95, 64, 1, 1)
    @rect['downleft'] = Rect.new(64, 95, 1, 1)
    @rect['downright'] = Rect.new(95, 95, 1, 1)      
  end
  #--------------------------------------------------------------------------
  # * Windowskin
  #--------------------------------------------------------------------------
  def skin=(skin)
    @skin = skin
    draw_rect
  end
  #--------------------------------------------------------------------------
  # * Width
  #--------------------------------------------------------------------------
  def width=(width)
    return if @width == width
    @width = width
    if @width == 0 and self.bitmap != nil
      self.bitmap.dispose
      self.bitmap = nil
    end
    draw_rect
  end
  #--------------------------------------------------------------------------
  # * Height
  #--------------------------------------------------------------------------
  def height=(height)
    return if @height == height
    @height = height
    if @height == 0 and self.bitmap != nil
      self.bitmap.dispose
      self.bitmap = nil
    end
    draw_rect
  end
  #--------------------------------------------------------------------------
  # * Set
  #--------------------------------------------------------------------------
  def set(x, y, width, height)
    self.x = x + 16
    self.y = y + 16
    if @width != width or @height != height
      @width = width
      @height = height
      if width > 0 and height > 0
        draw_rect
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Empty
  #--------------------------------------------------------------------------
  def empty
    self.x = 0
    self.y = 0
    self.width = 0
    self.height = 0
  end
  #--------------------------------------------------------------------------
  # * Draw Rectangle
  #--------------------------------------------------------------------------
  def draw_rect
    return if @skin == nil
    if @width > 0 and @height > 0
      self.bitmap = Bitmap.new(@width, @height)
      rect = Rect.new(1, 1, @width - 2, @height - 2)
      self.bitmap.stretch_blt(rect, @skin, @rect['bg'])
      self.bitmap.blt(0, 0, @skin, @rect['upleft'])
      self.bitmap.blt(@width-1, 0, @skin, @rect['upright'])
      self.bitmap.blt(0, @height-1, @skin, @rect['downright'])
      self.bitmap.blt(@width-1, @height-1, @skin, @rect['downleft'])
      rect = Rect.new(1, 0, @width - 2, 1)
      self.bitmap.stretch_blt(rect, @skin, @rect['cursor_up'])
      rect = Rect.new(0, 1, 1, @height - 2)
      self.bitmap.stretch_blt(rect, @skin, @rect['cursor_left'])
      rect = Rect.new(1, @height-1, @width - 2, 1)
      self.bitmap.stretch_blt(rect, @skin, @rect['cursor_down'])
      rect = Rect.new(@width - 1, 1, 1, @height - 2)
      self.bitmap.stretch_blt(rect, @skin, @rect['cursor_right'])
    end
  end
end

#==============================================================================
# Bitmap
#==============================================================================
class Bitmap
  #--------------------------------------------------------------------------
  # * Letter Width
  #--------------------------------------------------------------------------
  def letter_width
    return 12
  end
  #--------------------------------------------------------------------------
  # * Letter Height
  #--------------------------------------------------------------------------
  def letter_height
    return 28
  end
  #--------------------------------------------------------------------------
  # * Text Size
  #--------------------------------------------------------------------------
  alias custom_window_text_size text_size
  def text_size(*args)
    if CustomWindow::BITMAP_FONT
      Rect.new(0, 0, letter_width, letter_height)
    else
      custom_window_text_size(*args)
    end    
  end  
  #--------------------------------------------------------------------------
  # * Draw Text
  #--------------------------------------------------------------------------
  alias custom_window_draw_text draw_text
  def draw_text(*args)
    if CustomWindow::BITMAP_FONT
      draw_bitmap_text(*args)
    else
      if CustomWindow::GRADIENT
        draw_gradient_text(*args)
      else
        draw_shadow(*args) if CustomWindow::SHADOW
        custom_window_draw_text(*args)        
      end      
    end
  end  
  #--------------------------------------------------------------------------
  # * Return Arguments
  #--------------------------------------------------------------------------
  def return_args(*args)
    color = font.color.dup
    if args[0].is_a?(Rect)
      x, y, width, height = args[0].x, args[0].y, args[0].width, args[0].height
      text = args[1]
      align = args[2] == nil ? 0 : args[2]
    else
      x, y, width, height, text = args
      align = args[5] == nil ? 0 : args[5]
    end
    text = sprintf(text)
    return x, y, width, height, text, align, color
  end
  #--------------------------------------------------------------------------
  # * Draw Shadow
  #--------------------------------------------------------------------------
  def draw_shadow(*args)
    x, y, width, height, text, align, color = return_args(*args)
    font.color = Color.new(0, 0, 0)
    custom_window_draw_text(x + 2, y + 2, width, height, text, align)
    font.color = color
  end
  #--------------------------------------------------------------------------
  # * Draw Bitmap Text
  #--------------------------------------------------------------------------
  def draw_bitmap_text(*args)
    x, y, width, height, text, align, color = return_args(*args)
    input_string = []
    text.size.times do
      c = text.slice!(/./m)
      input_string.push(c)
    end
    size = input_string.size * letter_width
    case align
    when 1
      x = x + (width - size) / 2
    when 2
      x = x + width - size
    end
    black = Color.new(0, 0, 0)
    for letter in input_string
      print_letter(letter, x + 2, y + 2, black) if CustomWindow::SHADOW
      print_letter(letter, x, y, color)
      print_gradient_layer(letter, x, y, height, color) if CustomWindow::GRADIENT
      x += letter_width
    end
  end  
  #--------------------------------------------------------------------------
  # * Draw Gradient Text
  #--------------------------------------------------------------------------
  def draw_gradient_text(*args)
    x, y, width, height, text, align, color = return_args(*args)
    tmp = Bitmap.new(width, height)
    tmp2 = Bitmap.new(width, height)
    tmp.font.size = font.size
    tmp.font.name = font.name
    if CustomWindow::SHADOW
      tmp.font.color = Color.new(0, 0, 0)    
      tmp.custom_window_draw_text(2, 2, width, height, text, align)
    end
    tmp.font.color = color.gradient
    tmp.custom_window_draw_text(0, 0, width, height, text, align)    
    h = [tmp.text_size(text).height, 1].max
    p = (height / 2) - (h / 2)
    for i in 0...height
      opacity = set_opacity(i, p, h)
      tmp2.blt(0, i, tmp, Rect.new(0, i, width, 1), opacity)
    end
    temp_color = font.color
    font.color = color
    custom_window_draw_text(x, y, width, height, text, align)
    font.color = temp_color
    blt(x, y, tmp2, Rect.new(0, 0, width, height))      
    tmp.dispose
    tmp2.dispose
  end
  #--------------------------------------------------------------------------
  # * Print Gradient Layer
  #--------------------------------------------------------------------------
  def print_gradient_layer(letter, x, y, height, color)
    tmp = Bitmap.new(12, 28)
    tmp2 = Bitmap.new(12, 28)
    tmp.print_letter(letter, 0, 0, color.gradient)  
    h = letter_height
    p = (height / 2) - (h / 2)
    for i in 0...h
      opacity = set_opacity(i, p, h)
      tmp2.blt(0, i, tmp, Rect.new(0, i, 12, 1), opacity)
    end
    blt(x, y, tmp2, Rect.new(0, 0, 12, 28))      
    tmp.dispose
    tmp2.dispose    
  end
  #--------------------------------------------------------------------------
  # * Set Opacity
  #--------------------------------------------------------------------------
  def set_opacity(i, p, h)
    if i < p
      opacity = 0
    elsif i >= p + h
      opacity = 255
    else
      r = ((i - p) * 1.0 / h)
      r -= (0.5 - r) * 0.5
      opacity = r * 255
      opacity = 0 if opacity < 0
      opacity = 255 if opacity > 255
    end
    return opacity
  end
  #--------------------------------------------------------------------------
  # * Print Letter
  #--------------------------------------------------------------------------
  def print_letter(input, x, y, color)
    case input
    when "A"
      fill_rect(x, y + 16, 2, 8, color)
      fill_rect(x + 2, y + 10, 2, 6, color)
      fill_rect(x + 2, y + 18, 2, 2, color)        
      fill_rect(x + 4, y + 6, 2, 4, color)
      fill_rect(x + 2, y + 18, 6, 2, color)
      fill_rect(x + 2, y + 18, 6, 2, color)
      fill_rect(x + 6, y + 10, 2, 6, color)
      fill_rect(x + 8, y + 16, 2, 8, color)  
    when "Ą"
      fill_rect(x, y + 16, 2, 8, color)
      fill_rect(x + 2, y + 10, 2, 6, color)
      fill_rect(x + 2, y + 18, 2, 2, color)        
      fill_rect(x + 4, y + 6, 2, 4, color)
      fill_rect(x + 2, y + 18, 6, 2, color)
      fill_rect(x + 2, y + 18, 6, 2, color)
      fill_rect(x + 6, y + 10, 2, 6, color)
      fill_rect(x + 8, y + 16, 2, 8, color)
      fill_rect(x + 6, y + 24, 2, 2, color)
      fill_rect(x + 8, y + 26, 2, 2, color)
    when "B"
      fill_rect(x, y + 6, 2, 18, color)
      fill_rect(x + 2, y + 6, 6, 2, color)
      fill_rect(x + 2, y + 14, 6, 2, color)
      fill_rect(x + 2, y + 22, 6, 2, color)
      fill_rect(x + 8, y + 8, 2, 6, color)
      fill_rect(x + 8, y + 16, 2, 6, color)
    when "C"
      fill_rect(x, y + 8, 2, 14, color)      
      fill_rect(x + 2, y + 6, 6, 2, color)      
      fill_rect(x + 2, y + 22, 6, 2, color)      
      fill_rect(x + 8, y + 8, 2, 4, color)
      fill_rect(x + 8, y + 18, 2, 4, color)
    when "Ć"
      fill_rect(x, y + 8, 2, 14, color)      
      fill_rect(x + 2, y + 6, 6, 2, color)      
      fill_rect(x + 2, y + 22, 6, 2, color)      
      fill_rect(x + 8, y + 8, 2, 4, color)
      fill_rect(x + 8, y + 18, 2, 4, color)      
      fill_rect(x + 4, y + 4, 2, 2, color)
      fill_rect(x + 6, y + 2, 2, 2, color)
    when "D"
      fill_rect(x, y + 6, 2, 18, color)
      fill_rect(x + 2, y + 6, 4, 2, color)
      fill_rect(x + 2, y + 22, 4, 2, color)      
      fill_rect(x + 6, y + 8, 2, 2, color)
      fill_rect(x + 6, y + 20, 2, 2, color)
      fill_rect(x + 8, y + 10, 2, 10, color)
    when "E"
      fill_rect(x, y + 6, 2, 18, color)
      fill_rect(x + 2, y + 6, 8, 2, color)
      fill_rect(x + 2, y + 14, 6, 2, color)
      fill_rect(x + 2, y + 22, 8, 2, color)  
    when "Ę"
      fill_rect(x, y + 6, 2, 18, color)
      fill_rect(x + 2, y + 6, 8, 2, color)
      fill_rect(x + 2, y + 14, 6, 2, color)
      fill_rect(x + 2, y + 22, 8, 2, color)
      fill_rect(x + 6, y + 24, 2, 2, color)
      fill_rect(x + 8, y + 26, 2, 2, color)
    when "F"
      fill_rect(x, y + 6, 2, 18, color)
      fill_rect(x + 2, y + 6, 8, 2, color)
      fill_rect(x + 2, y + 14, 6, 2, color)
    when "G"
      fill_rect(x, y + 8, 2, 14, color)      
      fill_rect(x + 2, y + 6, 6, 2, color)      
      fill_rect(x + 2, y + 22, 4, 2, color)      
      fill_rect(x + 8, y + 8, 2, 4, color)
      fill_rect(x + 6, y + 16, 4, 2, color)      
      fill_rect(x + 8, y + 18, 2, 6, color)
      fill_rect(x + 6, y + 20, 2, 2, color)
    when "H"
      fill_rect(x, y + 6, 2, 18, color)
      fill_rect(x + 2, y + 14, 6, 2, color)
      fill_rect(x + 8, y + 6, 2, 18, color)      
    when "I"
      fill_rect(x + 2, y + 6, 6, 2, color)
      fill_rect(x + 4, y + 8, 2, 14, color)
      fill_rect(x + 2, y + 22, 6, 2, color)
    when "J"
      fill_rect(x, y + 18, 2, 4, color)
      fill_rect(x + 2, y + 22, 4, 2, color)  
      fill_rect(x + 6, y + 6, 2, 16, color)
    when "K"
      fill_rect(x, y + 6, 2, 18, color)
      fill_rect(x + 2, y + 14, 2, 2, color)
      fill_rect(x + 4, y + 10, 2, 4, color)  
      fill_rect(x + 4, y + 16, 2, 4, color)
      fill_rect(x + 6, y + 6, 2, 4, color)
      fill_rect(x + 6, y + 20, 2, 4, color)
    when "L"
      fill_rect(x, y + 6, 2, 18, color)
      fill_rect(x + 2, y + 22, 8, 2, color)
    when "Ł"
      fill_rect(x, y + 6, 2, 18, color)
      fill_rect(x + 2, y + 22, 8, 2, color)  
      fill_rect(x + 2, y + 14, 2, 2, color)
      fill_rect(x + 4, y + 12, 2, 2, color)
    when "M"
      fill_rect(x, y + 6, 2, 18, color)
      fill_rect(x + 2, y + 10, 2, 6, color)
      fill_rect(x + 4, y + 16, 2, 8, color)
      fill_rect(x + 6, y + 10, 2, 6, color)
      fill_rect(x + 8, y + 6, 2, 18, color)  
    when "N"
      fill_rect(x, y + 6, 2, 18, color)
      fill_rect(x + 2, y + 8, 2, 4, color)      
      fill_rect(x + 4, y + 12, 2, 6, color)      
      fill_rect(x + 6, y + 18, 2, 4, color)
      fill_rect(x + 8, y + 6, 2, 18, color)  
    when "Ń"
      fill_rect(x, y + 6, 2, 18, color)
      fill_rect(x + 2, y + 8, 2, 4, color)      
      fill_rect(x + 4, y + 12, 2, 6, color)      
      fill_rect(x + 6, y + 18, 2, 4, color)
      fill_rect(x + 8, y + 6, 2, 18, color)  
      fill_rect(x + 4, y + 4, 2, 2, color)
      fill_rect(x + 6, y + 2, 2, 2, color)
    when "O"
      fill_rect(x, y + 8, 2, 14, color)      
      fill_rect(x + 2, y + 6, 6, 2, color)      
      fill_rect(x + 2, y + 22, 6, 2, color)      
      fill_rect(x + 8, y + 8, 2, 14, color)  
    when "Ó"
      fill_rect(x, y + 8, 2, 14, color)      
      fill_rect(x + 2, y + 6, 6, 2, color)      
      fill_rect(x + 2, y + 22, 6, 2, color)      
      fill_rect(x + 8, y + 8, 2, 14, color)  
      fill_rect(x + 4, y + 4, 2, 2, color)
      fill_rect(x + 6, y + 2, 2, 2, color)
    when "P"
      fill_rect(x, y + 6, 2, 18, color)
      fill_rect(x + 2, y + 6, 6, 2, color)
      fill_rect(x + 2, y + 14, 6, 2, color)
      fill_rect(x + 8, y + 8, 2, 6, color)
    when "Q"
      fill_rect(x, y + 8, 2, 14, color)      
      fill_rect(x + 2, y + 6, 6, 2, color)      
      fill_rect(x + 2, y + 22, 4, 2, color)      
      fill_rect(x + 8, y + 8, 2, 14, color)
      fill_rect(x + 4, y + 18, 2, 2, color)
      fill_rect(x + 6, y + 20, 2, 2, color)
      fill_rect(x + 8, y + 22, 2, 2, color)
    when "R"
      fill_rect(x, y + 6, 2, 18, color)
      fill_rect(x + 2, y + 6, 6, 2, color)
      fill_rect(x + 2, y + 14, 6, 2, color)
      fill_rect(x + 8, y + 8, 2, 6, color)
      fill_rect(x + 6, y + 16, 2, 2, color)
      fill_rect(x + 8, y + 18, 2, 6, color)
    when "S"
      fill_rect(x, y + 8, 2, 4, color)  
      fill_rect(x, y + 18, 2, 4, color)      
      fill_rect(x + 2, y + 6, 6, 2, color)
      fill_rect(x + 2, y + 22, 6, 2, color)
      fill_rect(x + 2, y + 12, 2, 2, color)
      fill_rect(x + 4, y + 14, 2, 2, color)
      fill_rect(x + 6, y + 16, 2, 2, color)
      fill_rect(x + 8, y + 8, 2, 4, color)  
      fill_rect(x + 8, y + 18, 2, 4, color)
    when "Ś"
      fill_rect(x, y + 8, 2, 4, color)  
      fill_rect(x, y + 18, 2, 4, color)      
      fill_rect(x + 2, y + 6, 6, 2, color)
      fill_rect(x + 2, y + 22, 6, 2, color)
      fill_rect(x + 2, y + 12, 2, 2, color)
      fill_rect(x + 4, y + 14, 2, 2, color)
      fill_rect(x + 6, y + 16, 2, 2, color)
      fill_rect(x + 8, y + 8, 2, 4, color)  
      fill_rect(x + 8, y + 18, 2, 4, color)
      fill_rect(x + 4, y + 4, 2, 2, color)
      fill_rect(x + 6, y + 2, 2, 2, color)
    when "T"
      fill_rect(x, y + 6, 10, 2, color)      
      fill_rect(x + 4, y + 8, 2, 16, color)  
    when "U"
      fill_rect(x, y + 6, 2, 16, color)      
      fill_rect(x + 2, y + 22, 6, 2, color)      
      fill_rect(x + 8, y + 6, 2, 16, color)  
    when "V"
      fill_rect(x, y + 6, 2, 6, color)      
      fill_rect(x + 2, y + 12, 2, 6, color)
      fill_rect(x + 4, y + 18, 2, 6, color)
      fill_rect(x + 6, y + 12, 2, 6, color)
      fill_rect(x + 8, y + 6, 2, 6, color)
    when "W"
      fill_rect(x, y + 6, 2, 10, color)      
      fill_rect(x + 2, y + 16, 2, 8, color)
      fill_rect(x + 4, y + 6, 2, 10, color)
      fill_rect(x + 6, y + 16, 2, 8, color)
      fill_rect(x + 8, y + 6, 2, 10, color)
    when "X"
      fill_rect(x, y + 6, 2, 4, color)
      fill_rect(x, y + 20, 2, 4, color)
      fill_rect(x + 2, y + 10, 2, 4, color)
      fill_rect(x + 2, y + 16, 2, 4, color)
      fill_rect(x + 4, y + 14, 2, 2, color)
      fill_rect(x + 6, y + 10, 2, 4, color)
      fill_rect(x + 6, y + 16, 2, 4, color)
      fill_rect(x + 8, y + 6, 2, 4, color)
      fill_rect(x + 8, y + 20, 2, 4, color)
    when "Y"
      fill_rect(x, y + 6, 2, 4, color)
      fill_rect(x + 2, y + 10, 2, 4, color)
      fill_rect(x + 4, y + 14, 2, 10, color)
      fill_rect(x + 6, y + 10, 2, 4, color)
      fill_rect(x + 8, y + 6, 2, 4, color)
    when "Z"
      fill_rect(x, y + 6, 10, 2, color)
      fill_rect(x + 8, y + 8, 2, 2, color)
      fill_rect(x + 6, y + 10, 2, 4, color)
      fill_rect(x + 4, y + 14, 2, 2, color)
      fill_rect(x + 2, y + 16, 2, 4, color)
      fill_rect(x, y + 20, 2, 2, color)
      fill_rect(x, y + 22, 10, 2, color)
    when "Ź"
      fill_rect(x, y + 6, 10, 2, color)
      fill_rect(x + 8, y + 8, 2, 2, color)
      fill_rect(x + 6, y + 10, 2, 4, color)
      fill_rect(x + 4, y + 14, 2, 2, color)
      fill_rect(x + 2, y + 16, 2, 4, color)
      fill_rect(x, y + 20, 2, 2, color)
      fill_rect(x, y + 22, 10, 2, color)
      fill_rect(x + 4, y + 4, 2, 2, color)
      fill_rect(x + 6, y + 2, 2, 2, color)
    when "Ż"
      fill_rect(x, y + 6, 10, 2, color)
      fill_rect(x + 8, y + 8, 2, 2, color)
      fill_rect(x + 6, y + 10, 2, 4, color)
      fill_rect(x + 4, y + 14, 2, 2, color)
      fill_rect(x + 2, y + 16, 2, 4, color)
      fill_rect(x, y + 20, 2, 2, color)
      fill_rect(x, y + 22, 10, 2, color)
      fill_rect(x + 4, y + 2, 2, 2, color)
    when "a"
      fill_rect(x, y + 14, 2, 2, color)      
      fill_rect(x, y + 18, 2, 4, color)
      fill_rect(x + 2, y + 12, 4, 2, color)
      fill_rect(x + 2, y + 16, 4, 2, color)
      fill_rect(x + 2, y + 22, 4, 2, color)
      fill_rect(x + 6, y + 14, 2, 8, color)
      fill_rect(x + 8, y + 22, 2, 2, color)
    when "ą"
      fill_rect(x, y + 14, 2, 2, color)      
      fill_rect(x, y + 18, 2, 4, color)
      fill_rect(x + 2, y + 12, 4, 2, color)
      fill_rect(x + 2, y + 16, 4, 2, color)
      fill_rect(x + 2, y + 22, 4, 2, color)
      fill_rect(x + 6, y + 14, 2, 8, color)
      fill_rect(x + 8, y + 22, 2, 2, color)      
      fill_rect(x + 6, y + 24, 2, 2, color)
      fill_rect(x + 8, y + 26, 2, 2, color)
    when "b"
      fill_rect(x, y + 6, 2, 18, color)  
      fill_rect(x + 2, y + 12, 6, 2, color)
      fill_rect(x + 2, y + 22, 6, 2, color)
      fill_rect(x + 8, y + 14, 2, 8, color)
    when "c"
      fill_rect(x, y + 14, 2, 8, color)  
      fill_rect(x + 2, y + 12, 6, 2, color)
      fill_rect(x + 2, y + 22, 6, 2, color)
      fill_rect(x + 8, y + 14, 2, 2, color)
      fill_rect(x + 8, y + 20, 2, 2, color)
    when "ć"
      fill_rect(x, y + 14, 2, 8, color)  
      fill_rect(x + 2, y + 12, 6, 2, color)
      fill_rect(x + 2, y + 22, 6, 2, color)
      fill_rect(x + 8, y + 14, 2, 2, color)
      fill_rect(x + 8, y + 20, 2, 2, color)      
      fill_rect(x + 4, y + 8, 2, 2, color)
      fill_rect(x + 6, y + 6, 2, 2, color)      
    when "d"
      fill_rect(x, y + 14, 2, 8, color)  
      fill_rect(x + 2, y + 12, 6, 2, color)
      fill_rect(x + 2, y + 22, 6, 2, color)    
      fill_rect(x + 8, y + 6, 2, 18, color)    
    when "e"
      fill_rect(x, y + 14, 2, 8, color)  
      fill_rect(x + 2, y + 12, 6, 2, color)
      fill_rect(x + 2, y + 22, 6, 2, color)
      fill_rect(x + 8, y + 14, 2, 2, color)
      fill_rect(x + 8, y + 20, 2, 2, color)
      fill_rect(x + 2, y + 16, 8, 2, color)
    when "ę"
      fill_rect(x, y + 14, 2, 8, color)  
      fill_rect(x + 2, y + 12, 6, 2, color)
      fill_rect(x + 2, y + 22, 6, 2, color)
      fill_rect(x + 8, y + 14, 2, 2, color)
      fill_rect(x + 8, y + 20, 2, 2, color)
      fill_rect(x + 2, y + 16, 8, 2, color)
      fill_rect(x + 6, y + 24, 2, 2, color)
      fill_rect(x + 8, y + 26, 2, 2, color)
    when "f"
      fill_rect(x, y + 12, 2, 2, color)  
      fill_rect(x + 2, y + 8, 2, 16, color)
      fill_rect(x + 4, y + 6, 4, 2, color)
      fill_rect(x + 4, y + 12, 2, 2, color)  
    when "g"
      fill_rect(x, y + 14, 2, 2, color)      
      fill_rect(x, y + 18, 2, 2, color)
      fill_rect(x, y + 22, 2, 2, color)
      fill_rect(x + 2, y + 12, 4, 2, color)
      fill_rect(x + 2, y + 16, 4, 2, color)
      fill_rect(x + 2, y + 20, 6, 2, color)
      fill_rect(x + 2, y + 24, 6, 2, color)
      fill_rect(x + 6, y + 14, 2, 2, color)
      fill_rect(x + 8, y + 12, 2, 2, color)
      fill_rect(x + 8, y + 22, 2, 2, color)  
    when "h"
      fill_rect(x, y + 6, 2, 18, color)  
      fill_rect(x + 2, y + 12, 6, 2, color)      
      fill_rect(x + 8, y + 14, 2, 10, color)
    when "i"
      fill_rect(x + 4, y + 6, 2, 4, color)  
      fill_rect(x + 4, y + 12, 2, 12, color)
    when "j"
      fill_rect(x + 4, y + 6, 2, 4, color)  
      fill_rect(x + 4, y + 12, 2, 12, color)
      fill_rect(x , y + 24, 4, 2, color)
    when "k"
      fill_rect(x, y + 6, 2, 18, color)  
      fill_rect(x + 2, y + 18, 4, 2, color)
      fill_rect(x + 4, y + 16, 2, 2, color)
      fill_rect(x + 6, y + 14, 2, 2, color)
      fill_rect(x + 8, y + 12, 2, 2, color)
      fill_rect(x + 6, y + 20, 2, 2, color)
      fill_rect(x + 8, y + 22, 2, 2, color)
    when "l"
      fill_rect(x + 4, y + 6, 2, 18, color)
    when "ł"
      fill_rect(x + 4, y + 6, 2, 18, color)  
      fill_rect(x + 2, y + 14, 2, 2, color)
      fill_rect(x + 6, y + 12, 2, 2, color)
    when "m"
      fill_rect(x, y + 12, 2, 12, color)
      fill_rect(x + 2, y + 12, 2, 2, color)
      fill_rect(x + 4, y + 14, 2, 10, color)      
      fill_rect(x + 6, y + 12, 2, 2, color)
      fill_rect(x + 8, y + 14, 2, 10, color)  
    when "n"
      fill_rect(x, y + 12, 2, 12, color)
      fill_rect(x + 2, y + 12, 6, 2, color)
      fill_rect(x + 8, y + 14, 2, 10, color)
    when "ń"
      fill_rect(x, y + 12, 2, 12, color)
      fill_rect(x + 2, y + 12, 6, 2, color)
      fill_rect(x + 8, y + 14, 2, 10, color)
      fill_rect(x + 4, y + 8, 2, 2, color)
      fill_rect(x + 6, y + 6, 2, 2, color)
    when "o"
      fill_rect(x, y + 14, 2, 8, color)  
      fill_rect(x + 2, y + 12, 6, 2, color)
      fill_rect(x + 2, y + 22, 6, 2, color)
      fill_rect(x + 8, y + 14, 2, 8, color)
    when "ó"
      fill_rect(x, y + 14, 2, 8, color)  
      fill_rect(x + 2, y + 12, 6, 2, color)
      fill_rect(x + 2, y + 22, 6, 2, color)
      fill_rect(x + 8, y + 14, 2, 8, color)
      fill_rect(x + 4, y + 8, 2, 2, color)
      fill_rect(x + 6, y + 6, 2, 2, color)
    when "p"
      fill_rect(x, y + 12, 2, 14, color)  
      fill_rect(x + 2, y + 12, 6, 2, color)
      fill_rect(x + 2, y + 22, 6, 2, color)
      fill_rect(x + 8, y + 14, 2, 8, color)  
    when "q"
      fill_rect(x, y + 14, 2, 8, color)  
      fill_rect(x + 2, y + 12, 6, 2, color)
      fill_rect(x + 2, y + 22, 6, 2, color)
      fill_rect(x + 8, y + 12, 2, 14, color)  
    when "r"
      fill_rect(x + 2, y + 12, 2, 12, color)  
      fill_rect(x + 4, y + 14, 2, 2, color)
      fill_rect(x + 6, y + 12, 4, 2, color)
    when "s"
      fill_rect(x, y + 14, 2, 2, color)      
      fill_rect(x, y + 20, 2, 2, color)
      fill_rect(x + 2, y + 12, 6, 2, color)      
      fill_rect(x + 2, y + 16, 4, 2, color)      
      fill_rect(x + 2, y + 22, 6, 2, color)
      fill_rect(x + 8, y + 14, 2, 2, color)
      fill_rect(x + 6, y + 18, 2, 2, color)
      fill_rect(x + 8, y + 20, 2, 2, color)
    when "ś"
      fill_rect(x, y + 14, 2, 2, color)      
      fill_rect(x, y + 20, 2, 2, color)
      fill_rect(x + 2, y + 12, 6, 2, color)      
      fill_rect(x + 2, y + 16, 4, 2, color)      
      fill_rect(x + 2, y + 22, 6, 2, color)
      fill_rect(x + 8, y + 14, 2, 2, color)
      fill_rect(x + 6, y + 18, 2, 2, color)
      fill_rect(x + 8, y + 20, 2, 2, color)  
      fill_rect(x + 4, y + 8, 2, 2, color)
      fill_rect(x + 6, y + 6, 2, 2, color)
    when "t"
      fill_rect(x, y + 12, 6, 2, color)
      fill_rect(x + 2, y + 6, 2, 16, color)
      fill_rect(x + 4, y + 22, 4, 2, color)
    when "u"
      fill_rect(x, y + 12, 2, 10, color)
      fill_rect(x + 2, y + 22, 8, 2, color)
      fill_rect(x + 8, y + 12, 2, 10, color)
    when "v"
      fill_rect(x, y + 12, 2, 4, color)      
      fill_rect(x + 2, y + 16, 2, 4, color)      
      fill_rect(x + 4, y + 20, 2, 4, color)
      fill_rect(x + 6, y + 16, 2, 4, color)
      fill_rect(x + 8, y + 12, 2, 4, color)
    when "w"
      fill_rect(x, y + 12, 2, 6, color)      
      fill_rect(x + 2, y + 18, 2, 6, color)
      fill_rect(x + 4, y + 12, 2, 6, color)
      fill_rect(x + 6, y + 18, 2, 6, color)
      fill_rect(x + 8, y + 12, 2, 6, color)
    when "x"      
      fill_rect(x, y + 12, 2, 2, color)
      fill_rect(x, y + 22, 2, 2, color)
      fill_rect(x + 2, y + 14, 2, 2, color)
      fill_rect(x + 2, y + 20, 2, 2, color)
      fill_rect(x + 4, y + 16, 2, 4, color)
      fill_rect(x + 6, y + 14, 2, 2, color)
      fill_rect(x + 6, y + 20, 2, 2, color)
      fill_rect(x + 8, y + 12, 2, 2, color)
      fill_rect(x + 8, y + 22, 2, 2, color)
    when "y"
      fill_rect(x, y + 12, 2, 4, color)      
      fill_rect(x + 2, y + 16, 2, 4, color)      
      fill_rect(x + 4, y + 20, 2, 4, color)
      fill_rect(x + 6, y + 16, 2, 4, color)
      fill_rect(x + 8, y + 12, 2, 4, color)    
      fill_rect(x, y + 24, 4, 2, color)      
    when "z"
      fill_rect(x, y + 12, 10, 2, color)
      fill_rect(x + 8, y + 14, 2, 2, color)
      fill_rect(x + 6, y + 16, 2, 2, color)
      fill_rect(x + 4, y + 18, 2, 2, color)
      fill_rect(x + 2, y + 20, 2, 2, color)
      fill_rect(x, y + 22, 10, 2, color)
    when "ź"
      fill_rect(x, y + 12, 10, 2, color)
      fill_rect(x + 8, y + 14, 2, 2, color)
      fill_rect(x + 6, y + 16, 2, 2, color)
      fill_rect(x + 4, y + 18, 2, 2, color)
      fill_rect(x + 2, y + 20, 2, 2, color)
      fill_rect(x, y + 22, 10, 2, color)
      fill_rect(x + 4, y + 8, 2, 2, color)
      fill_rect(x + 6, y + 6, 2, 2, color)
    when "ż"  
      fill_rect(x, y + 12, 10, 2, color)
      fill_rect(x + 8, y + 14, 2, 2, color)
      fill_rect(x + 6, y + 16, 2, 2, color)
      fill_rect(x + 4, y + 18, 2, 2, color)
      fill_rect(x + 2, y + 20, 2, 2, color)
      fill_rect(x, y + 22, 10, 2, color)
      fill_rect(x + 4, y + 8, 2, 2, color)    
    when "0"  
      fill_rect(x, y + 8, 2, 14, color)      
      fill_rect(x + 2, y + 6, 4, 2, color)      
      fill_rect(x + 2, y + 22, 4, 2, color)      
      fill_rect(x + 6, y + 8, 2, 14, color)  
    when "1"  
      fill_rect(x + 2, y + 8, 2, 2, color)      
      fill_rect(x + 4, y + 6, 2, 18, color)
    when "2"  
      fill_rect(x, y + 8, 2, 4, color)      
      fill_rect(x + 2, y + 6, 4, 2, color)  
      fill_rect(x + 6, y + 8, 2, 6, color)
      fill_rect(x + 4, y + 14, 2, 2, color)
      fill_rect(x + 2, y + 16, 2, 4, color)
      fill_rect(x, y + 20, 2, 4, color)
      fill_rect(x + 2, y + 22, 6, 2, color)
    when "3"  
      fill_rect(x, y + 8, 2, 4, color)      
      fill_rect(x + 2, y + 6, 4, 2, color)  
      fill_rect(x + 6, y + 8, 2, 6, color)
      fill_rect(x + 2, y + 14, 4, 2, color)  
      fill_rect(x + 6, y + 16, 2, 6, color)
      fill_rect(x + 2, y + 22, 4, 2, color)
      fill_rect(x, y + 18, 2, 4, color)
    when "4"  
      fill_rect(x, y + 16, 2, 4, color)      
      fill_rect(x + 2, y + 12, 2, 4, color)
      fill_rect(x + 4, y + 8, 2, 4, color)
      fill_rect(x + 6, y + 6, 2, 18, color)
      fill_rect(x + 2, y + 18, 8, 2, color)
    when "5"  
      fill_rect(x, y + 6, 2, 10, color)
      fill_rect(x + 2, y + 6, 6, 2, color)
      fill_rect(x + 2, y + 12, 4, 2, color)
      fill_rect(x, y + 18, 2, 4, color)
      fill_rect(x + 2, y + 22, 4, 2, color)      
      fill_rect(x + 6, y + 14, 2, 8, color)      
    when "6"  
      fill_rect(x, y + 8, 2, 14, color)      
      fill_rect(x + 2, y + 6, 4, 2, color)      
      fill_rect(x + 2, y + 14, 4, 2, color)
      fill_rect(x + 2, y + 22, 4, 2, color)
      fill_rect(x + 6, y + 8, 2, 4, color)
      fill_rect(x + 6, y + 16, 2, 6, color)
    when "7"
      fill_rect(x, y + 6, 8, 2, color)
      fill_rect(x + 6, y + 8, 2, 4, color)
      fill_rect(x + 4, y + 12, 2, 6, color)
      fill_rect(x + 2, y + 18, 2, 6, color)
    when "8"
      fill_rect(x, y + 8, 2, 6, color)      
      fill_rect(x + 2, y + 6, 4, 2, color)  
      fill_rect(x + 6, y + 8, 2, 6, color)      
      fill_rect(x + 2, y + 14, 4, 2, color)      
      fill_rect(x + 6, y + 16, 2, 6, color)      
      fill_rect(x + 2, y + 22, 4, 2, color)
      fill_rect(x, y + 16, 2, 6, color)
    when "9"  
      fill_rect(x, y + 8, 2, 6, color)      
      fill_rect(x + 2, y + 6, 4, 2, color)      
      fill_rect(x + 6, y + 8, 2, 14, color)      
      fill_rect(x + 2, y + 14, 4, 2, color)            
      fill_rect(x + 2, y + 22, 4, 2, color)
      fill_rect(x, y + 18, 2, 4, color)
    when "."  
      fill_rect(x + 2, y + 20, 4, 4, color)
    when ","  
      fill_rect(x + 2, y + 20, 4, 2, color)
      fill_rect(x + 4, y + 22, 2, 2, color)
      fill_rect(x + 2, y + 24, 2, 2, color)  
    when "-"  
      fill_rect(x, y + 14, 8, 2, color)
    when ":"
      fill_rect(x + 4, y + 10, 2, 4, color)
      fill_rect(x + 4, y + 18, 2, 4, color)
    when "!"  
      fill_rect(x + 4, y + 6, 2, 12, color)
      fill_rect(x + 4, y + 20, 2, 4, color)
    when "?"  
      fill_rect(x, y + 8, 2, 4, color)      
      fill_rect(x + 2, y + 6, 4, 2, color)  
      fill_rect(x + 6, y + 8, 2, 6, color)
      fill_rect(x + 4, y + 14, 2, 4, color)
      fill_rect(x + 4, y + 20, 2, 4, color)
    when "'"
      fill_rect(x + 2, y + 2, 4, 2, color)
      fill_rect(x + 4, y + 4, 2, 2, color)
      fill_rect(x + 2, y + 6, 2, 2, color)  
    when "/"
      fill_rect(x + 8, y + 4, 2, 4, color)
      fill_rect(x + 6, y + 8, 2, 4, color)
      fill_rect(x + 4, y + 12, 2, 6, color)
      fill_rect(x + 2, y + 18, 2, 4, color)
      fill_rect(x, y + 22, 2, 4, color)
    when "["
      fill_rect(x + 2, y + 6, 2, 18, color)
      fill_rect(x + 4, y + 6, 4, 2, color)
      fill_rect(x + 4, y + 22, 4, 2, color)
    when "]"
      fill_rect(x + 6, y + 6, 2, 18, color)
      fill_rect(x + 2, y + 6, 4, 2, color)
      fill_rect(x + 2, y + 22, 4, 2, color)  
    end    
  end  
  #--------------------------------------------------------------------------
  # * Erase
  #--------------------------------------------------------------------------
  def erase(*args)
    if args.size == 1
      rect = args[0]
    elsif args.size == 4
      rect = Rect.new(*args)
    end
    fill_rect(rect, Color.new(0, 0, 0, 0))
  end    
end

#==============================================================================
# Window_Base
#==============================================================================
class Window_Base < Window
  #--------------------------------------------------------------------------
  # * Get Text Color
  #     n : text color number (0-15)
  #--------------------------------------------------------------------------
  def text_color(n)    
    n = 0 if n > 15
    color = @skin.bitmap.get_pixel(n % 4 * 16, 64 + (n / 4 * 16))
    self.contents.font.color.gradient = @skin.bitmap.get_pixel(n % 4 * 16, 79 + (n / 4 * 16))
    return color
  end
  #--------------------------------------------------------------------------
  # * Get Normal Text Color
  #--------------------------------------------------------------------------
  def normal_color; text_color(0); end
  #--------------------------------------------------------------------------
  # * Get Disabled Text Color
  #--------------------------------------------------------------------------
  def disabled_color; text_color(3); end
  #--------------------------------------------------------------------------
  # * Get System Text Color
  #--------------------------------------------------------------------------
  def system_color; text_color(1); end
  #--------------------------------------------------------------------------
  # * Get Crisis Text Color
  #--------------------------------------------------------------------------
  def crisis_color; text_color(8); end
  #--------------------------------------------------------------------------
  # * Get Knockout Text Color
  #--------------------------------------------------------------------------
  def knockout_color; text_color(2); end
end

[Obrazek: aye_furniture_pres.png]
05-02-15 22:09
Znajdź wszystkie posty użytkownika Odpowiedz cytując ten post
"Pomógł" przyznał(a):
BeVoo Offline
*


Liczba postów: 29
Dołączył: 07-07-13

Pomógł: 0



Post: #9
RE: Czcionka z RM2k

Wow, świetny efekt z tą czcionką, Ayene! :ok:

Klik! > [Obrazek: fAjISnc.png]
05-02-15 22:59
Znajdź wszystkie posty użytkownika Odpowiedz cytując ten post
"Pomógł" przyznał(a):
Dragon Kamillo Offline
*


Liczba postów: 330
Dołączył: 28-04-13

Pomógł: 24



Post: #10
RE: Czcionka z RM2k

Jesteś genialna.

Pytanie: czy będzie to współgrało ze skryptem z pierwszego postu. Jeśli tak, to już się cieszę.

Ciekawe czy zadziała też w ACE.

Lece testować.

EDIT: Po testowałem i jest problem z cieniem jeśli połączymy te dwa skrypty.
Cień wyświetla się podwójnie. Może wystarczy wywalić z pierwszego skryptu wyświetlanie cienia.

A i mam pytanie, gdzie w windowskinie ustalamy gradient na cień?
(Ten post był ostatnio modyfikowany: 06-02-15 20:49 przez Dragon Kamillo.)
06-02-15 20:42
Znajdź wszystkie posty użytkownika Odpowiedz cytując ten post
"Pomógł" przyznał(a):
Odpowiedz 


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.