class WAD::Playpal

Overview

Color palettes for various situations.

Included Modules

Defined in:

wa-cr/wad/wad-data/texture.cr
write.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from module WritingAdditions::Playpal

write(file : String | Path) : UInt32
write(io : IO) : UInt32
write

Constructor Detail

def self.parse(filename : String | Path) : Playpal #

Parses a playpal file given the filename

Opens a playpal file and parses it:

my_playpal = WAD::Playpal.parse("Path/To/Playpal")

def self.parse(io : IO) : Playpal #

Parses a playpal file given the io

Opens a playpal io and parses it:

File.open("Path/To/Playpal") do |file|
  my_playpal = WAD::Playpal.parse(file)
end

Class Method Detail

def self.is_playpal?(name : String) #

Checks to see if name is "PLAYPAL"

Returns true if the name is a playpal:

playpal_name = "PLAYPAL"
if WAD::Playpal.is_playpal?(playpal_name)
  puts "Is a Playpal"
else
  puts "Is not a Playpal"
end

Instance Method Detail

def clone #

Returns a copy of self with all instance variables cloned.


def palettes : Array(Palette) #

def palettes=(palettes : Array(Palette)) #