Camera in 0.6.0
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Camera in 0.6.0
I thought I saw a lib to do that a while ago, but I couldn't find it anymore..
-
- Party member
- Posts: 215
- Joined: Sun Jan 18, 2009 8:03 pm
Re: Camera in 0.6.0
For future support, I think lateInit() should be there anyhow but you're right, it does nothing for your project.konsumer wrote:Igor: it still doesn't do anything. that is for a mouse-based camera, right? I'm not using that.
I've attached an updated version for Camera. It is not complete; there is a misplacement of images when rotating the screen and there are some optimizations to be made. It also needs compatability code for 0.5.0 (the old versions will however always be in wiki history). I will probably replace most of the transformation with what rude suggested but for your needs, the functionality should hopefully be the same anyhow.
Using a tilemap that only draws the visible tiles, instead of everything and then applying a camera, seems highly useful, even necessary. There are still common features that are being used and perhaps these could be added to camera. I would recommend that you use getCamera():isShapeVisible(shape) or getCamera():isRectangleVisible(x1, y1, x2, y2) before drawing sprites. For tilemaps, I plan to add a function for getting the range of tiles that are visible.
- Attachments
-
- main.lua
- Test program for Camera 4a.
- (11.25 KiB) Downloaded 122 times
-
- camera.lua
- Camera 4a. Beta for LÖVE 0.6.0.
- (20.66 KiB) Downloaded 122 times
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.
- Star Crunch
- Prole
- Posts: 33
- Joined: Sun Feb 15, 2009 12:13 am
- Location: Monterrey, MX
- Contact:
Re: Camera in 0.6.0
Maybe one of these?bartbes wrote:I thought I saw a lib to do that a while ago, but I couldn't find it anymore..
http://cairographics.org
http://www.antigrain.com
Cairo has a few bindings:
http://luaforge.net/projects/luacairo
http://luaforge.net/projects/oocairo
http://www.dynaset.org/dogusanh/luacairo.html
I thought Rude or Mike said something elsewhere about rejecting it because it was too heavy, though...
Not sure about Anti-Grain bindings, or its license for that matter.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Camera in 0.6.0
No, I meant a lua implementation that someone from our community coded and had integrated with LÖVE.
-
- Party member
- Posts: 215
- Joined: Sun Jan 18, 2009 8:03 pm
Re: Camera in 0.6.0
Someone did code an interpreter for basic SVG and talked about it on IRC, but I do not remember who it was. I definitely think we should have one.
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.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Camera in 0.6.0
That would be insanely cool. Anyone who knows who this individual was?osuf oboys wrote:Someone did code an interpreter for basic SVG and talked about it on IRC, but I do not remember who it was. I definitely think we should have one.
Help us help you: attach a .love.
-
- Party member
- Posts: 215
- Joined: Sun Jan 18, 2009 8:03 pm
Re: Camera in 0.6.0
SVG is built on XML though so it should be easy for anyone skilled and motivated to take up this project. Preferably though, I would like to see it in the LÖVE engine. If not, it might be better to have more of a community project with iterative improvements than for someone to make the basics and haphazard imporvements for extensions.Robin wrote:That would be insanely cool. Anyone who knows who this individual was?osuf oboys wrote:Someone did code an interpreter for basic SVG and talked about it on IRC, but I do not remember who it was. I definitely think we should have one.
For instance, drawing a rectangle is just
Code: Select all
<rect x="50" y="50" width="460" height="230" fill="#3377aa" />
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.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Camera in 0.6.0
True, but Lua is not really that great with string handling -- Lua can handle SVG, i'm sure, but it's going to be awkward. I think we need a small and sleek C++ lib, preferably an existing one.osuf oboys wrote:SVG is built on XML though so it should be easy for anyone skilled and motivated to take up this project. Preferably though, I would like to see it in the LÖVE engine. If not, it might be better to have more of a community project with iterative improvements than for someone to make the basics and haphazard imporvements for extensions.
For instance, drawing a rectangle is justCode: Select all
<rect x="50" y="50" width="460" height="230" fill="#3377aa" />
Help us help you: attach a .love.
Re: Camera in 0.6.0
The most viable option would seem to be Antigrain, though I don't know how large it is or what problems it might cause. Also, the current version is available under the GPL only; the previous version is usable under a very liberal public license, though (do whatever you like as long as this notice is included).
There's also ShivaVG (C, not C++), which purports to implement the OpenVG standard, but I haven't tested it and the latest version available for download (on its Sourceforge page) is 0.2.1, and that came out nearly a year ago. It seems like the project might be abandoned, and I don't know how complete it currently is, or of what quality.
It might still be worth checking out, though!
(There's also KompazzVG, which looks quite nice, but the author hasn't actually released any source yet, so that's not really an option.)
There's also ShivaVG (C, not C++), which purports to implement the OpenVG standard, but I haven't tested it and the latest version available for download (on its Sourceforge page) is 0.2.1, and that came out nearly a year ago. It seems like the project might be abandoned, and I don't know how complete it currently is, or of what quality.
It might still be worth checking out, though!
(There's also KompazzVG, which looks quite nice, but the author hasn't actually released any source yet, so that's not really an option.)
Who is online
Users browsing this forum: Google [Bot] and 4 guests