Animation drawing?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Surgeon
Prole
Posts: 1
Joined: Thu May 10, 2012 11:04 am

Animation drawing?

Post by Surgeon »

Hey!

I've been trying löve for the past few days and I can't seem to find a way to draw an animation inverted in relation to the Yy axis. Do I have to have separate animations for left/right facing character?

Thanks! :awesome:
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Animation drawing?

Post by Robin »

Hi!

See love.graphics.draw. If the fifth argument (sx) is negative, it is flipped horizontally, so you can do something like:

Code: Select all

love.graphics.draw(something.image, something.x, something.y, 0, something.dx < 0 and -1 or 1)
Hope that helps. :)
Help us help you: attach a .love.
coffee
Party member
Posts: 1206
Joined: Wed Nov 02, 2011 9:07 pm

Re: Animation drawing?

Post by coffee »

Surgeon wrote:Hey!

I've been trying löve for the past few days and I can't seem to find a way to draw an animation inverted in relation to the Yy axis. Do I have to have separate animations for left/right facing character?

Thanks! :awesome:
Also too more things to what robin said. Remember that flipping the image isn't good if let's say you character isn't a symmetrical Image. if you have an sword in right hand flipping/inverting will show sword then in left hand.

Also remember that LOVE don't do image animation as default (like using a GIF). You will need to use some animation library or create a simple one of ours.
User avatar
juno
Citizen
Posts: 85
Joined: Thu May 10, 2012 4:32 pm
Location: London

Re: Animation drawing?

Post by juno »

In relation to what coffee wrote..
If you have a character which is non symmetrical and is made up of >1 shapes, when it is flipped, the shape, body, fixtures dont flip with the image. Does anyone have a solution to this?
wat ya mean she's in another castle!?
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 5 guests