class WAD::Playpal
- WAD::Playpal
- Reference
- Object
Overview
Color palettes for various situations.
Included Modules
Defined in:
wa-cr/wad/wad-data/texture.crwrite.cr
Constructors
-
.parse(filename : String | Path) : Playpal
Parses a playpal file given the filename
-
.parse(io : IO) : Playpal
Parses a playpal file given the io
Class Method Summary
-
.is_playpal?(name : String)
Checks to see if name is "PLAYPAL"
Instance Method Summary
-
#clone
Returns a copy of
self
with all instance variables cloned. - #palettes : Array(Palette)
- #palettes=(palettes : Array(Palette))
Instance methods inherited from module WritingAdditions::Playpal
write(file : String | Path) : UInt32write(io : IO) : UInt32 write
Constructor Detail
Parses a playpal file given the filename
Opens a playpal file and parses it:
my_playpal = WAD::Playpal.parse("Path/To/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