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.
class Game < Gosu::Window
SQUARE_WIDTH = SQUARE_HEIGHT = 32
super(640, 480, false)
self.caption = "Game of Life"
@x = 0
@y = 0
@block_color = Gosu::Color.argb(0xffff0000)
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)
Has anyone else had this problem?
Can you please attach a screenshot of what this looks like? Which version of Gosu is this?
Gosu used to expect this order of coordinates: top left, top right, bottom left, bottom right. I think it was in the middle of the 0.7.x series when I started accepting clockwise order as well. Just to make sure, can you see if it works if you replace the 3rd and 4th coordinates?
I've tried both ways. If I give you a screenshot of the above, you won't see anything, so notice that I am changing the width/height.
Gosu version 0.7.50
Edit: image is breaking, so I hard posted the link.
So with the original values of 32/32 it does not work?
I expect that it does, but it is rendered off-screen. The interesting thing is that it is not just my code, but all tutorials I've copied an pasted from. Are there incompatibility issues with Mac?
No, Gosu is primarily developed on a Mac (several of them, actually ;) ). Are you on a Retina Mac?
If you happen to have
sdl2 installed via homebrew, you can try if this solves the issue:
gem install gosu --pre
I'm new to Macs and was just given one when I got my new job. I pretty sure it was brand new, so I imagine it is retina. gem install gosu --pre worked great; well, except for the fact that the quad is in the wrong location until I move the window around the screen. But I can deal with that. I'm just writing Conway's Game of Life at the moment. Thanks for the help!
And I will also keep track of the issues page.
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill