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.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: scrolling and scaling
-
- Party member
- Posts: 215
- Joined: Sun Jan 18, 2009 8:03 pm
Re: CAMERA: scrolling and scaling
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.
Re: CAMERA: scrolling and scaling
This is full of awesome and win.
EDIT: Nothiiiing
EDIT: Nothiiiing
-
- Party member
- Posts: 215
- Joined: Sun Jan 18, 2009 8:03 pm
Re: CAMERA: scrolling and scaling
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.
Re: CAMERA: scrolling and scaling
I don't know what to say, it's so impressive and smooth...
Re: CAMERA: scrolling and scaling
What was CAMERA originally licensed under?
-
- Party member
- Posts: 215
- Joined: Sun Jan 18, 2009 8:03 pm
Re: CAMERA: scrolling and scaling
It was vaguely said to be "open source" and "wikified".Skofo wrote:What was CAMERA originally licensed under?
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.
-
- Party member
- Posts: 215
- Joined: Sun Jan 18, 2009 8:03 pm
Re: CAMERA: scrolling and scaling
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.
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 219 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.
Re: CAMERA: scrolling and scaling
Whoaa, rotation. This is so kickass! : Thanks so much for making this.
EDIT: The demo makes me dizzyyyy...
EDIT: The demo makes me dizzyyyy...
-
- Party member
- Posts: 215
- Joined: Sun Jan 18, 2009 8:03 pm
Re: CAMERA: scrolling and scaling
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.
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.
Re: CAMERA: scrolling and scaling
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)
Who is online
Users browsing this forum: No registered users and 3 guests