I am trying to draw a square, but it draws offscreen. This happens even if I am using other's example code. Larger shapes will be drawn, but portions will be drawn offscreen.
require 'gosu'
class Game < Gosu::Window
SQUARE_WIDTH = SQUARE_HEIGHT = 32
def initialize
super(640, 480, false)
self.caption = "Game of Life"
@x = 0
@y = 0
@block_color = Gosu::Color.argb(0xffff0000)
end
def update
end
def draw
draw_quad(@x, @y, @block_color,
@x + SQUARE_WIDTH, @y, @block_color,
@x + SQUARE_WIDTH, @y + SQUARE_HEIGHT, @block_color,
@x, @y + SQUARE_HEIGHT, @block_color)
end
end
Game.new.show
Has anyone else had this problem?
Loading...