Class: GGLib::Image

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

Direct Known Subclasses

Texture

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(x, y, z, src, hardBorders = true, tracer = "None", no = nil) ⇒ Image

Returns a new instance of Image.



110
111
112
113
114
115
116
117
118
# File 'lib/image.rb', line 110

def initialize(x,y,z,src,hardBorders=true,tracer="None",no=nil)
  @obj=Gosu::Image.new($window,src,hardBorders)
  @src=src
  @x=x
  @y=y
  @z=z
  @id=no
  @descr=tracer
end

Instance Attribute Details

#descrObject (readonly)

Returns the value of attribute descr.



109
110
111
# File 'lib/image.rb', line 109

def descr
  @descr
end

#idObject (readonly)

Returns the value of attribute id.



109
110
111
# File 'lib/image.rb', line 109

def id
  @id
end

#objObject (readonly)

Returns the value of attribute obj.



109
110
111
# File 'lib/image.rb', line 109

def obj
  @obj
end

#srcObject (readonly)

Returns the value of attribute src.



109
110
111
# File 'lib/image.rb', line 109

def src
  @src
end

#xObject (readonly)

Returns the value of attribute x.



109
110
111
# File 'lib/image.rb', line 109

def x
  @x
end

#yObject (readonly)

Returns the value of attribute y.



109
110
111
# File 'lib/image.rb', line 109

def y
  @y
end

#zObject (readonly)

Returns the value of attribute z.



109
110
111
# File 'lib/image.rb', line 109

def z
  @z
end

Instance Method Details

#delObject



127
128
129
# File 'lib/image.rb', line 127

def del
  @obj,@x,@y,@z,@id=nil    
end

#draw(x = @x, y = @y, z = @z) ⇒ Object



119
120
121
# File 'lib/image.rb', line 119

def draw(x=@x,y=@y,z=@z)
  @obj.draw(x,y,z)
end

#setPos(x, y = @y, z = @z) ⇒ Object



122
123
124
125
126
# File 'lib/image.rb', line 122

def setPos(x,y=@y,z=@z)
  @x=x
  @y=y
  @z=z
end