The RPG Maker Resource Kit

RMRK RPG Maker Creation => VX Ace => VXA Scripts Database => Topic started by: modern algebra on February 04, 2012, 11:53:54 PM

Title: [VXA] Extended Colour Palette
Post by: modern algebra on February 04, 2012, 11:53:54 PM
Extended Colour Palette
Version: 1.0
Author: modern algebra
Date: February 4, 2012

Version History



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


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: (https://rmrk.net/index.php?action=dlattach;topic=37477.0;attach=19468;image)

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

Script


Code: [Select]
#==============================================================================
#    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



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.