lib/rubygoo/adapters/gosu_render_adapter.rb in rubygoo-0.0.7 vs lib/rubygoo/adapters/gosu_render_adapter.rb in rubygoo-0.0.8
- old
+ new
@@ -24,10 +24,15 @@
@window.draw_line x2, y1, c, x2, y2, c
@window.draw_line x2, y2, c, x1, y2, c
@window.draw_line x1, y2, c, x1, y1, c
end
+ def draw_line(x1,y1,x2,y2,color)
+ c = convert_color(color)
+ @window.draw_line x1, y1, c, x1, y2, c
+ end
+
CIRCLE_STEP = 10
def draw_circle(cx,cy,r,color)
c_color = convert_color(color)
0.step(360, CIRCLE_STEP) { |a1|
@@ -67,9 +72,26 @@
# z is unused here
if color
img.draw x, y, 0,1,1,convert_color(color)
else
img.draw x, y, 0
+ end
+ end
+
+ # untested in Gosu
+ def draw_partial_image(img, to_x, to_y,
+ from_x=nil,from_y=nil,from_w=nil,from_h=nil, color=nil)
+
+ if from_x
+ if from_w
+ from = [from_x,from_y,from_w,from_h]
+ image = Image.new @screen, img, false, from
+ else
+ raise "not supported in gosu"
+ end
+ image.draw x, y, 0
+ else
+ draw_image img,to_x,to_y,color
end
end
def size_text(text, font_file, font_size)
@font_cache ||= {}