[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Rubygame -- need help with zoom

Bryan Richardson

8/8/2008 4:15:00 PM

Hello all,

I'm trying to get a Rubygame example to zoom, and can't seem to do so.
Right now, I'm simply drawing a single pixel at the center of the
screen, then trying to zoom when I press the space bar. I have my event
queue set up right, because if I tell it to print something when the
space bar is pressed it works. Here's how I'm trying to zoom:

@screen.zoom_to(@screen.w / 2, @screen.h / 2) if event.key ==
Rubygame::K_SPACE
@screen.update

Anyone know why this isn't working? The pixel at the center of the
screen stays the same size...

--
Thanks!
Bryan
--
Posted via http://www.ruby-....

3 Answers

d c

8/8/2008 4:23:00 PM

0

is a 1pixel x 1pixel object fixed at that size, ignoring scale?
have you tried drawing a box or translating it?

/dc

On Sat, Aug 9, 2008 at 1:14 AM, Bryan Richardson <btrichardson@gmail.com> wrote:
> Hello all,
>
> I'm trying to get a Rubygame example to zoom, and can't seem to do so.
> Right now, I'm simply drawing a single pixel at the center of the
> screen, then trying to zoom when I press the space bar. I have my event
> queue set up right, because if I tell it to print something when the
> space bar is pressed it works. Here's how I'm trying to zoom:
>
> @screen.zoom_to(@screen.w / 2, @screen.h / 2) if event.key ==
> Rubygame::K_SPACE
> @screen.update
>
> Anyone know why this isn't working? The pixel at the center of the
> screen stays the same size...
>
> --
> Thanks!
> Bryan
> --
> Posted via http://www.ruby-....
>
>

Bryan Richardson

8/8/2008 5:13:00 PM

0

Ah... good point. I'll try that.

--
Thanks!
Bryan

David Collier wrote:
> is a 1pixel x 1pixel object fixed at that size, ignoring scale?
> have you tried drawing a box or translating it?
>
> /dc

--
Posted via http://www.ruby-....

Bryan Richardson

8/8/2008 6:48:00 PM

0

Hi Again David,

So I drew a polygon using the code below, but the screen still doesn't
zoom...

@screen.draw_polygon([ [10,10], [200,10], [200,200], [10,200], [10,10]
], [255,11,147])


Am I still missing something?

--
Thanks!
Bryan

David Collier wrote:
> is a 1pixel x 1pixel object fixed at that size, ignoring scale?
> have you tried drawing a box or translating it?
>
> /dc

--
Posted via http://www.ruby-....