Class: RPG::Animation::Frame

Inherits:
Object
  • Object
show all
Defined in:
lib/rpg/animation.rb

Overview

Data class for animation frames.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFrame

Returns a new instance of Frame.



48
49
50
51
# File 'lib/rpg/animation.rb', line 48

def initialize
  @cell_max = 0
  @cell_data = Table.new(0, 0)
end

Instance Attribute Details

#cell_dataObject

2-dimensional array containing cell contents (Table).

Generally takes the form cell_data[cell_index, data_index].

data_index ranges from 0 to 7 and denotes various information about a cell:

0

pattern

1

X-coordinate

2

Y-coordinate

3

zoom level

4

angle of rotation

5

horizontal flip

6

opacity

7

blending mode

Patterns are 1 less than the number displayed in RPGXP; -1 indicates that that cell is not in use.



73
74
75
# File 'lib/rpg/animation.rb', line 73

def cell_data
  @cell_data
end

#cell_maxObject

Number of cells. Equivalent to the largest cell number in the frame set.



54
55
56
# File 'lib/rpg/animation.rb', line 54

def cell_max
  @cell_max
end