Main Menu
  • Welcome to The RPG Maker Resource Kit.

[VXA] Extended Colour Palette

Started by modern algebra, February 04, 2012, 11:53:54 PM

0 Members and 1 Guest are viewing this topic.

modern algebra

Extended Colour Palette
Version: 1.0
Author: modern algebra
Date: February 4, 2012

Version History




  • <Version 1.0> 2012.02.04 - Original Release

Description



This script allows you to have more colours beyond the 32 in the windowskin. It's primary use will be in messages, as you can now put in codes higher than \c[31]. Any numbers below 32 will take the colours from the windowskin.

Features


  • Allows you to use more colours for text display than provided in the windowskin

Instructions

Paste this script into its own slot in the Script Editor, above Main but below Materials.

You will need to make a "Palette" graphic and save it in the System folder of Graphics. The format of the "Palette" Graphic should be that it is 64 pixels wide. Each colour should be in an 8x8 square and you can have as many rows of them as you like. It will count left and then down, so 32-39 would be colours on the first row, 40-47 would be colours on the second row, etc. The graphic must be named "Palette".

A sample palette graphic:

Using that palette, \c[36] would show the text in the brown colour, first row, fifth column.

Script




#==============================================================================
#    Extended Colour Palette
#    Version: 1.0
#    Author: modern algebra (rmrk.net)
#    Date: February 4, 2012
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Description:
#
#    This script allows you to have more colours beyond the 32 in the
#   windowskin. It's primary use will be in messages, as you can now put in
#   codes higher than \c[31]. Any numbers below 32 will take the colours from
#   the windowskin.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Instructions:
#
#    Paste this script into its own slot in the Script Editor, above Main but
#   below Materials.
#
#    You will need to make a "Palette" graphic and save it in the System folder
#   of Graphics. The format of the "Palette" Graphic should be that it is 64
#   pixels wide. Each colour should be in an 8x8 square and you can have as
#   many rows of them as you like. It will count left and then down, so 32-39
#   would be colours on the first row, 40-47 would be colours on the second
#   row, etc. The graphic must be named "Palette".
#==============================================================================

$imported ||= {}
$imported[:MA_ExtendedColourPalette] = true

#==============================================================================
# ** Window_Base
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased method - text_color
#==============================================================================

class Window_Base
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Text Color
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias mamc_textcolor_4rj6 text_color
  def text_color(n, *args, &block)
    if n < 32
      mamc_textcolor_4rj6(n, *args, &block) # Call Original Method
    else
      n -= 32
      Cache.system("Palette").get_pixel((n % 8) * 8, (n / 8) * 8)
    end
  end
end


Credit




  • modern algebra

Support



Please post in this thread at RMRK.net if you have any bugs to report or questions to ask.

Known Compatibility Issues

No known compatibility issues.

Author's Notes



I have been working on tedious scripts, so I figured I'd do something quick.