Method: Gosu::TexChunk#initialize

Defined in:
lib/gosu_android/graphics/texChunk.rb

#initialize(graphics, queues, texture, x, y, w, h, padding) ⇒ TexChunk

Returns a new instance of TexChunk.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/gosu_android/graphics/texChunk.rb', line 6

def initialize(graphics, queues, texture, x, y, w, h, padding)
  @graphics = graphics
  @queues = queues
  @texture = texture
  #Define object destructor
  ObjectSpace.define_finalizer(self, Proc.new{@texture.finalize})
  @x = x
  @y = y
  @w = w
  @h = h
  @padding = padding
  @info = GLTexInfo.new
  @info.tex_name = @texture.tex_name
  #Force float division
  @info.left = @x.to_f / @texture.size
  @info.top = @y.to_f / @texture.size
  @info.right = (@x.to_f + @w) / @texture.size
  @info.bottom = (@y.to_f + @h) / @texture.size
end