Module: Converter

Defined in:
docs/4_Systems_003_Map_Engine.rb

Overview

Module that helps to convert stuff

Constant Summary collapse

Autotiles =

The autotile builder data

[[[27, 28, 33, 34], [5, 28, 33, 34], [27, 6, 33, 34], [5, 6, 33, 34], [27, 28, 33, 12], [5, 28, 33, 12], [27, 6, 33, 12], [5, 6, 33, 12]], [[27, 28, 11, 34], [5, 28, 11, 34], [27, 6, 11, 34], [5, 6, 11, 34], [27, 28, 11, 12], [5, 28, 11, 12], [27, 6, 11, 12], [5, 6, 11, 12]], [[25, 26, 31, 32], [25, 6, 31, 32], [25, 26, 31, 12], [25, 6, 31, 12], [15, 16, 21, 22], [15, 16, 21, 12], [15, 16, 11, 22], [15, 16, 11, 12]], [[29, 30, 35, 36], [29, 30, 11, 36], [5, 30, 35, 36], [5, 30, 11, 36], [39, 40, 45, 46], [5, 40, 45, 46], [39, 6, 45, 46], [5, 6, 45, 46]], [[25, 30, 31, 36], [15, 16, 45, 46], [13, 14, 19, 20], [13, 14, 19, 12], [17, 18, 23, 24], [17, 18, 11, 24], [41, 42, 47, 48], [5, 42, 47, 48]], [[37, 38, 43, 44], [37, 6, 43, 44], [13, 18, 19, 24], [13, 14, 43, 44], [37, 42, 43, 48], [17, 18, 47, 48], [13, 18, 43, 48], [1, 2, 7, 8]]]
SRC =

The source rect (to draw autotiles)

Rect.new(0, 0, 16, 16)

Class Method Summary collapse

Class Method Details

.convert_autotile(filename)

Convert an autotile file to a specific autotile file

Examples:

Converter.convert_autotile(“Graphics/autotiles/eauca.png”)

Parameters:



586
587
# File 'docs/4_Systems_003_Map_Engine.rb', line 586

def convert_autotile(filename)
end

.generate_autotile_bmp(id, autotiles) ⇒ Texture

Generate one tile of an autotile

Parameters:

  • id (Integer)

    id of the tile

  • autotiles (Array<Texture>)

    autotiles bitmaps

Returns:

  • (Texture)

    the calculated bitmap



596
597
# File 'docs/4_Systems_003_Map_Engine.rb', line 596

def generate_autotile_bmp(id, autotiles)
end