Page 2 of 6

Re: CAMERA: scrolling and scaling

Posted: Mon Feb 02, 2009 2:12 pm
by osuf oboys
justindz wrote:Hi. I'm new to Lua and Love (but not to programming) and I'm interested in doing some smooth-scrolling console-ish RPGs. It seems like Camera would be useful in this endeavor, but I'm wondering if you have some insight as to whether Camera could actually be used to produce the smooth-scrolling tile-based engines itself. I am currently trying to adjust the Love tutorial tile engine, but am having issues in my graphic noobiness getting it from tile-at-a-time to pixels-as-you-go scrolling and could use some direction/advice/assistance.
CAMERA provides the scrolling effect simply by dropping the file into your game folder and adding a couple of lines. See the examples at http://love2d.org/wiki/index.php?title=CAMERA_Examples . Using CAMERA does not change much as far as designing the engine goes - you just call setCamera here and there. You may want to take a look at ËNVY as well, it might make life even easier.

Re: CAMERA: scrolling and scaling

Posted: Thu Feb 05, 2009 12:35 pm
by Skofo
This is full of awesome and win.

EDIT: Nothiiiing :ultraglee:

Re: CAMERA: scrolling and scaling

Posted: Sun Feb 15, 2009 12:13 pm
by osuf oboys
Version 2c. Fixed a bug: 'limit' was not scaled before splitting lines in 'drawf'. (Fixed on the wiki the 8th but not released on the forum until now.)

Re: CAMERA: scrolling and scaling

Posted: Sun Feb 15, 2009 10:00 pm
by farvardin
I don't know what to say, it's so impressive and smooth...

Re: CAMERA: scrolling and scaling

Posted: Sat Feb 21, 2009 12:00 am
by Skofo
What was CAMERA originally licensed under?

Re: CAMERA: scrolling and scaling

Posted: Sat Feb 21, 2009 12:09 am
by osuf oboys
Skofo wrote:What was CAMERA originally licensed under?
It was vaguely said to be "open source" and "wikified".

Re: CAMERA: scrolling and scaling

Posted: Sun Feb 22, 2009 1:53 am
by osuf oboys
CAMERA has been updated to version 3 and now features scene rotation around the origin of the world (as requested by sslaxx). The two functions of interest are <some camera>:setRotation(rot) and <some camera>:rotateBy(rot, ox, oy) where ox and oy are points to rotate around. The rotation is in degrees and counter-clockwise (subject to change) and the default ox and oy is the current origin of the screen.

See the original post or the wiki for the download and more info. Note that it doesn't work very well with aspect ratios different than the aspect ratio of the camera. I think it would be better to make the default scaleToResolution draw a screen with the right aspect ratio and fill out with black borders as needed.

A better demo of these functions will hopefully be produced. For now, an annoying demo of BallForAStroll where you see the world from the ball's perspective and the GUI spins for some reasons. Note that the drawf text still lines up and that you can still click on the spinning minimap buttons.

Clarification about LPCL: just don't call it CAMERA and you can do whatever you want with it, with or without notices or licenses. We'll post an updated version of LPCL soon which clearly only makes statements about the trademark rights, thereby allowing an independent choice the copyright and hopefully making the license easier to understand and more accepted.

Re: CAMERA: scrolling and scaling

Posted: Sun Feb 22, 2009 2:36 am
by Skofo
Whoaa, rotation. This is so kickass! :ultrashocked:: Thanks so much for making this.

EDIT: The demo makes me dizzyyyy... :shock:

Re: CAMERA: scrolling and scaling

Posted: Sun Feb 22, 2009 1:09 pm
by osuf oboys
3b: fixed a bug in one of the examples on the wiki as reported by illidane. setCamera(nil) does not change the current camera now.

EDIT: bartbes was not saying anything in particular.

Re: CAMERA: scrolling and scaling

Posted: Sun Feb 22, 2009 1:26 pm
by mike
That is funky effect, but the debug text (like the amount of BALLS that have been drawn seems to be subject to the rotation, which I am guessing isn't a part of the point?