# Rubygame -- need help with zoom

**URL:** <https://www.ruby-forum.com/t/rubygame-need-help-with-zoom/145395>\
**Category:** Ruby\
**Created:** [August 8, 2008, 6:16pm UTC](https://www.ruby-forum.com/t/rubygame-need-help-with-zoom/145395 "2008-08-08T18:16:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![roxah](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/54ee81/32.png) [@roxah](https://www.ruby-forum.com/u/roxah)\
**Post date:** [August 8, 2008, 6:16pm UTC](https://www.ruby-forum.com/t/rubygame-need-help-with-zoom/145395/1 "2008-08-08T18:16:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![roxah](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/54ee81/32.png) [@roxah](https://www.ruby-forum.com/u/roxah)\
**Post date:** [August 8, 2008, 6:25pm UTC](https://www.ruby-forum.com/t/rubygame-need-help-with-zoom/145395/2 "2008-08-08T18:25:58Z")

</div>

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

/dc

---

<div class="post-metadata">

**Author:** ![roxah](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/54ee81/32.png) [@roxah](https://www.ruby-forum.com/u/roxah)\
**Post date:** [August 8, 2008, 7:14pm UTC](https://www.ruby-forum.com/t/rubygame-need-help-with-zoom/145395/3 "2008-08-08T19:14:34Z")

</div>

Ah… good point. I’ll try that.

–  
Thanks!  
Bryan

David C. wrote:

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

---

<div class="post-metadata">

**Author:** ![roxah](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/54ee81/32.png) [@roxah](https://www.ruby-forum.com/u/roxah)\
**Post date:** [August 8, 2008, 8:50pm UTC](https://www.ruby-forum.com/t/rubygame-need-help-with-zoom/145395/4 "2008-08-08T20:50:22Z")

</div>

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 C. wrote:

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