ippa / jaws

Jaws - HTML5 canvas javascript 2D Game Framework
https://jawsjs.ippa.se
GNU Lesser General Public License v3.0
363 stars 75 forks source link

About the viewport bound #65

Open plko opened 11 years ago

plko commented 11 years ago

Hello, I'm trying to use jaws to make a game, and I want scroll the screen when player leave.

I use "viewport.isInside(player)" to do this, but here has some problem.

It is a board game, one step is 32px, and my screen size is 320x320(10x10 square on screen), viewport's height & width is 320 too, x & y range is 0~319 from top left corner. When player is on (320,y) or (x,320), the 11st square, it is totally leave the screen but viewport still think player is inside the viewport.

This may because min of x & y is 0, and min of height & width is 1?

Last, I have one more question, why you made "jaws.cutImage (image, x, y, width, height)" as private? I think this is a useful function :P

Thanks!

ippa commented 11 years ago

hi, gone for a few days, I'll try to take a look at this when I'm back!

ippa commented 11 years ago

Hi.. it was more then a few days I guess ;). Do you still have the problem?

If you wan't me to take a look at it I'll need a demo online somewhere, otherwise it's very hard for me to find out what's wrong. Preferable a very simple example showing the "bug" :).