Class: MagicaVoxel::Pattle

Inherits:
Chunk
  • Object
show all
Defined in:
lib/magica_voxel/pattle.rb

Overview

The Chunk type RGBA

Since:

  • 0.1.0

Constant Summary

Constants inherited from Chunk

Chunk::TYPES

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Chunk

#each, header, #initialize, read

Constructor Details

This class inherits a constructor from MagicaVoxel::Chunk

Instance Attribute Details

#pattleObject (readonly)

Since:

  • 0.1.0



9
10
11
# File 'lib/magica_voxel/pattle.rb', line 9

def pattle
  @pattle
end

Instance Method Details

#[](id) ⇒ MagicVoxel::Color

Get color by index

Parameters:

  • id (Number)

Returns:

  • (MagicVoxel::Color)

Since:

  • 0.1.0



18
19
20
# File 'lib/magica_voxel/pattle.rb', line 18

def [](id)
  @pattle[id]
end

#inspectObject

:nodoc

Since:

  • 0.1.0



25
26
27
# File 'lib/magica_voxel/pattle.rb', line 25

def inspect
  '#<MagicaVoxel::Pattle>'
end