Graphics, Characters, Text & Rooms: Difference between revisions

Line 226: Line 226:


==Having a character continuously animated in the background==
==Having a character continuously animated in the background==
''When I animate my character or object, it jerks around from left to right all the time. I've checked everything, and all of my frames were imported correctly. What could be the problem?''
''I would like to have my character continuously animating in the background, but if I loop it continuously, I get errors and/or strange things happen. Or, I just can't get it to work! Help!''


Well, the most common cause for this problem is that each frame of this animation has a different width (bear in mind that the character sprites are all pivoted at the centre of the base). Resize all the images to the same width (I would recommending finding out the largest width out of all the images and resize them all accordingly). You might have to play around with moving each frame from left to right to get them aligned. Jasc's Animation Shop is perfect for resizing (cropping) and alterations like the above.
Ooooh, sorry, that wasn't in the form of a question! ;)
 
Heh just kidding. You can use the character's idle animation to do this. Simply set up his/her idle animation ('''SetCharacterIdle()''', or '''cEgo.SetIdleView()''' for AGS V2.7 and above) with the idle delay to "0" so that it plays constantly. Voila! You now have a repeatedly animating background character with only one line of script. If you wanted, for example, a character in the background to do a one-time animation randomly with pauses between, set the idle delay to a higher number. The higher the idle delay, the longer between idle animations AGS will wait.


==Jerky character/sprite animation==
==Jerky character/sprite animation==