Page 2 of 2

Re: Camera in 0.6.0

Posted: Fri Jan 08, 2010 1:46 pm
by bartbes
I thought I saw a lib to do that a while ago, but I couldn't find it anymore..

Re: Camera in 0.6.0

Posted: Sat Jan 09, 2010 6:48 pm
by osuf oboys
konsumer wrote:Igor: it still doesn't do anything. that is for a mouse-based camera, right? I'm not using that.
For future support, I think lateInit() should be there anyhow but you're right, it does nothing for your project.

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.

Re: Camera in 0.6.0

Posted: Sun Jan 10, 2010 6:41 am
by Star Crunch
bartbes wrote:I thought I saw a lib to do that a while ago, but I couldn't find it anymore..
Maybe one of these?

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.

Re: Camera in 0.6.0

Posted: Sun Jan 10, 2010 8:53 am
by bartbes
No, I meant a lua implementation that someone from our community coded and had integrated with LÖVE.

Re: Camera in 0.6.0

Posted: Sun Jan 10, 2010 11:14 am
by osuf oboys
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.

Re: Camera in 0.6.0

Posted: Sun Jan 10, 2010 11:20 am
by Robin
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.
That would be insanely cool. Anyone who knows who this individual was?

Re: Camera in 0.6.0

Posted: Sun Jan 10, 2010 3:50 pm
by osuf oboys
Robin wrote:
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.
That would be insanely cool. Anyone who knows who this individual was?
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 just

Code: Select all

<rect x="50" y="50" width="460" height="230" fill="#3377aa" />

Re: Camera in 0.6.0

Posted: Sun Jan 10, 2010 4:03 pm
by Robin
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 just

Code: Select all

<rect x="50" y="50" width="460" height="230" fill="#3377aa" />
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.

Re: Camera in 0.6.0

Posted: Sun Jan 10, 2010 6:56 pm
by bmelts
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.)