CAMERA: scrolling and scaling

Showcase your libraries, tools and other projects that help your fellow love users.
osuf oboys
Party member
Posts: 215
Joined: Sun Jan 18, 2009 8:03 pm

Re: CAMERA: scrolling and scaling

Post 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.
If I haven't written anything else, you may assume that my work is released under the LPC License - the LÖVE Community. See http://love2d.org/wiki/index.php?title=LPC_License.
User avatar
Skofo
Party member
Posts: 146
Joined: Mon Dec 22, 2008 10:55 pm

Re: CAMERA: scrolling and scaling

Post by Skofo »

This is full of awesome and win.

EDIT: Nothiiiing :ultraglee:
Working on: Viator
Need a 64-bit Debian package for LÖVE? Here it is!
osuf oboys
Party member
Posts: 215
Joined: Sun Jan 18, 2009 8:03 pm

Re: CAMERA: scrolling and scaling

Post 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.)
If I haven't written anything else, you may assume that my work is released under the LPC License - the LÖVE Community. See http://love2d.org/wiki/index.php?title=LPC_License.
User avatar
farvardin
Party member
Posts: 167
Joined: Sat Jun 28, 2008 6:46 pm

Re: CAMERA: scrolling and scaling

Post by farvardin »

I don't know what to say, it's so impressive and smooth...
User avatar
Skofo
Party member
Posts: 146
Joined: Mon Dec 22, 2008 10:55 pm

Re: CAMERA: scrolling and scaling

Post by Skofo »

What was CAMERA originally licensed under?
Working on: Viator
Need a 64-bit Debian package for LÖVE? Here it is!
osuf oboys
Party member
Posts: 215
Joined: Sun Jan 18, 2009 8:03 pm

Re: CAMERA: scrolling and scaling

Post by osuf oboys »

Skofo wrote:What was CAMERA originally licensed under?
It was vaguely said to be "open source" and "wikified".
If I haven't written anything else, you may assume that my work is released under the LPC License - the LÖVE Community. See http://love2d.org/wiki/index.php?title=LPC_License.
osuf oboys
Party member
Posts: 215
Joined: Sun Jan 18, 2009 8:03 pm

Re: CAMERA: scrolling and scaling

Post 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.
Attachments
ballForAStroll2.love
Ball For a Stroll with rotation
(37.92 KiB) Downloaded 220 times
Last edited by osuf oboys on Sun Feb 22, 2009 3:21 am, edited 1 time in total.
If I haven't written anything else, you may assume that my work is released under the LPC License - the LÖVE Community. See http://love2d.org/wiki/index.php?title=LPC_License.
User avatar
Skofo
Party member
Posts: 146
Joined: Mon Dec 22, 2008 10:55 pm

Re: CAMERA: scrolling and scaling

Post by Skofo »

Whoaa, rotation. This is so kickass! :ultrashocked:: Thanks so much for making this.

EDIT: The demo makes me dizzyyyy... :shock:
Working on: Viator
Need a 64-bit Debian package for LÖVE? Here it is!
osuf oboys
Party member
Posts: 215
Joined: Sun Jan 18, 2009 8:03 pm

Re: CAMERA: scrolling and scaling

Post 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.
Last edited by osuf oboys on Sun Feb 22, 2009 3:30 pm, edited 1 time in total.
If I haven't written anything else, you may assume that my work is released under the LPC License - the LÖVE Community. See http://love2d.org/wiki/index.php?title=LPC_License.
User avatar
mike
Administrator
Posts: 364
Joined: Mon Feb 04, 2008 5:24 pm

Re: CAMERA: scrolling and scaling

Post 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?
Now posting IN STEREO (where available)
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests