Class: GGLib::Texture

Inherits:
Image
  • Object
show all
Defined in:
lib/image.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Image

#del, #setPos

Constructor Details

#initialize(x1, y1, x2, y2, z, src, hardBorders = true, tracer = "None", no = nil) ⇒ Texture

Returns a new instance of Texture.



134
135
136
137
138
139
140
141
142
143
144
# File 'lib/image.rb', line 134

def initialize(x1,y1,x2,y2,z,src,hardBorders=true,tracer="None",no=nil)
  @obj=Gosu::Image.new($window,src,hardBorders)
  @src=src.to_sym
  @x1=x1
  @y1=y1
  @x2=x2
  @y2=y2
  @z=z
  @id=no
  @descr=tracer
end

Instance Attribute Details

#descrObject (readonly)

Returns the value of attribute descr.



133
134
135
# File 'lib/image.rb', line 133

def descr
  @descr
end

#idObject (readonly)

Returns the value of attribute id.



133
134
135
# File 'lib/image.rb', line 133

def id
  @id
end

#objObject (readonly)

Returns the value of attribute obj.



133
134
135
# File 'lib/image.rb', line 133

def obj
  @obj
end

#srcObject (readonly)

Returns the value of attribute src.



133
134
135
# File 'lib/image.rb', line 133

def src
  @src
end

#x1Object (readonly)

Returns the value of attribute x1.



133
134
135
# File 'lib/image.rb', line 133

def x1
  @x1
end

#x2Object (readonly)

Returns the value of attribute x2.



133
134
135
# File 'lib/image.rb', line 133

def x2
  @x2
end

#y1Object (readonly)

Returns the value of attribute y1.



133
134
135
# File 'lib/image.rb', line 133

def y1
  @y1
end

#y2Object (readonly)

Returns the value of attribute y2.



133
134
135
# File 'lib/image.rb', line 133

def y2
  @y2
end

#zObject (readonly)

Returns the value of attribute z.



133
134
135
# File 'lib/image.rb', line 133

def z
  @z
end

Instance Method Details

#draw(x1 = @x1, y1 = @y1, x2 = @x2, y2 = @y2, z = @z) ⇒ Object



151
152
153
# File 'lib/image.rb', line 151

def draw(x1=@x1,y1=@y1,x2=@x2,y2=@y2,z=@z)
  @obj.draw_as_quad(x1, y1, 0xffffffff, x2, y1, 0xffffffff, x1, y2, 0xffffffff, x2, y2, 0xffffffff, z)
end

#xObject



145
146
147
# File 'lib/image.rb', line 145

def x
  return @x1
end

#yObject



148
149
150
# File 'lib/image.rb', line 148

def y 
  return @y1
end