Показано с 1 по 10 из 30

Тема: Жирный Шрифт!

Древовидный режим

Предыдущее сообщение Предыдущее сообщение   Следующее сообщение Следующее сообщение
  1. #18

    По умолчанию

    В наборе Tons of Addons есть скрипт Simple Shaded Text. Вот он отдельно:

    Код:
    #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
    # Simple Shaded Text by Blizzard
    # Version: 2.0b
    # Type: Text Readability Improvement
    # Date: 2.7.2006
    #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
    
    #==============================================================================
    # Game_System
    #==============================================================================
    
    class Game_System
      
      alias init_tons_of_addons1_later initialize
      def initialize
        init_tons_of_addons1_later
    #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    # START Configuration 1-2, GRAPHIC add-ons
    # 
    #   You can enable/disable any add-on here if you wish. Set the value to false
    #   to disable it initially. To turn it on/off ingame, just use the Call script
    #   command with one of these syntaxes:
    # 
    #     $game_system.NAME_OF_THE_ADDON = true
    #     $game_system.NAME_OF_THE_ADDON = false
    # 
    #   where NAME_OF_THE_ADDON is the same variable as the one used below.
    #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    
        @SHADED_TEXT                = true
    #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    # END Configuration 1-2
    #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
      end
      
    #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    # It is recommended that you don't edit anything below this line except for
    # the configurations for the add-ons.
    #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    
      attr_accessor :SHADED_TEXT
      
    end
    
    #==============================================================================
    # Bitmap
    #==============================================================================
    
    class Bitmap
      
      #---------------------------------------------------------------------------- 
      # draw_text
      #  x2    - x coordinate or rectangle
      #  y2    - y coordinate or text
      #  w2    - width or align
      #  h2    - height
      #  text2 - the text to be drawn
      #  a2    - align
      #  Added additional drawing to make the text look like shaded.
      #---------------------------------------------------------------------------- 
      alias draw_text_shaded_later draw_text
      def draw_text(x2, y2, w2 = 0, h2 = 0, text2 = '', a2 = 0)
        # set coordinates whether x2 is rectangle
        if x2.is_a?(Rect)
          x, y, w, h, text, a = x2.x, x2.y, x2.width, x2.height, y2, w2
        else
          x, y, w, h, text, a = x2, y2, w2, h2, text2, a2
        end
        # if active
        if $game_system != nil && $game_system.SHADED_TEXT
          # store font color
          save_color = self.font.color.clone
          # set font color to black
          self.font.color = Color.new(0, 0, 0)
          # draw shade
          draw_text_shaded_later(x+1, y+1, w, h, text, a)
          # restore font color
          self.font.color = save_color
        end
        # draw normal text
        draw_text_shaded_later(x, y, w, h, text, a)
      end
      #---------------------------------------------------------------------------- 
      # draw_text_full
      #  x2    - x coordinate or rectangle
      #  y2    - y coordinate or text
      #  w2    - width or align
      #  h2    - height
      #  text2 - the text to be drawn
      #  a2    - align
      #  Draws outlines text.
      #---------------------------------------------------------------------------- 
      def draw_text_full(x2, y2, w2 = 0, h2 = 0, text2 = '', a2 = 0)
        # set coordinates whether x2 is rectangle
        if x2.is_a?(Rect)
          x, y, w, h, text, a = x2.x, x2.y, x2.width, x2.height, y2, w2
        else
          x, y, w, h, text, a = x2, y2, w2, h2, text2, a2
        end
        # store font color
        save_color = self.font.color.clone
        # set font color to black
        self.font.color = Color.new(0, 0, 0)
        # draw outline
        draw_text_shaded_later(x+1, y+1, w, h, text, a)
        draw_text_shaded_later(x-1, y+1, w, h, text, a)
        draw_text_shaded_later(x-1, y-1, w, h, text, a)
        draw_text_shaded_later(x+1, y-1, w, h, text, a)
        # restore font color
        self.font.color = save_color
        # draw normal text
        draw_text_shaded_later(x, y, w, h, text, a)
      end
      
    end
    Просто копируется в отдельную категорию.
    Последний раз редактировалось Arnon; 28.03.2012 в 15:33.


    Dropbox — бесплатное хранилище файлов с прямыми ссылками.

    Humble Bundle — игры, подборки и наборы со скидками.

Информация о теме

Пользователи, просматривающие эту тему

Эту тему просматривают: 1 (пользователей: 0 , гостей: 1)

Социальные закладки

Социальные закладки

Ваши права

  • Вы не можете создавать новые темы
  • Вы не можете отвечать в темах
  • Вы не можете прикреплять вложения
  • Вы не можете редактировать свои сообщения
  •  
Жирный Шрифт!