Class: GGLib::Texture
Instance Attribute Summary collapse
-
#descr ⇒ Object
readonly
Returns the value of attribute descr.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#obj ⇒ Object
readonly
Returns the value of attribute obj.
-
#src ⇒ Object
readonly
Returns the value of attribute src.
-
#x1 ⇒ Object
readonly
Returns the value of attribute x1.
-
#x2 ⇒ Object
readonly
Returns the value of attribute x2.
-
#y1 ⇒ Object
readonly
Returns the value of attribute y1.
-
#y2 ⇒ Object
readonly
Returns the value of attribute y2.
-
#z ⇒ Object
readonly
Returns the value of attribute z.
Instance Method Summary collapse
- #draw(x1 = @x1, y1 = @y1, x2 = @x2, y2 = @y2, z = @z) ⇒ Object
-
#initialize(x1, y1, x2, y2, z, src, hardBorders = true, tracer = "None", no = nil) ⇒ Texture
constructor
A new instance of Texture.
- #x ⇒ Object
- #y ⇒ Object
Methods inherited from Image
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
#descr ⇒ Object (readonly)
Returns the value of attribute descr.
133 134 135 |
# File 'lib/image.rb', line 133 def descr @descr end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
133 134 135 |
# File 'lib/image.rb', line 133 def id @id end |
#obj ⇒ Object (readonly)
Returns the value of attribute obj.
133 134 135 |
# File 'lib/image.rb', line 133 def obj @obj end |
#src ⇒ Object (readonly)
Returns the value of attribute src.
133 134 135 |
# File 'lib/image.rb', line 133 def src @src end |
#x1 ⇒ Object (readonly)
Returns the value of attribute x1.
133 134 135 |
# File 'lib/image.rb', line 133 def x1 @x1 end |
#x2 ⇒ Object (readonly)
Returns the value of attribute x2.
133 134 135 |
# File 'lib/image.rb', line 133 def x2 @x2 end |
#y1 ⇒ Object (readonly)
Returns the value of attribute y1.
133 134 135 |
# File 'lib/image.rb', line 133 def y1 @y1 end |
#y2 ⇒ Object (readonly)
Returns the value of attribute y2.
133 134 135 |
# File 'lib/image.rb', line 133 def y2 @y2 end |
#z ⇒ Object (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 |
#x ⇒ Object
145 146 147 |
# File 'lib/image.rb', line 145 def x return @x1 end |
#y ⇒ Object
148 149 150 |
# File 'lib/image.rb', line 148 def y return @y1 end |