View Full Version: Using sprite view angles

lassie >>Knowledge Base >>Using sprite view angles


<< Prev | Next >>

bigmac- 01-11-2007
Using sprite view angles
Howdy folks, just wanted to write a little article here about a subject that I'm learning about myself: using view angles. They're part of a "big picture" in Lassie, though unfortunately the picture is big enough that I can't focus on it all at once. So even I'm a little confused. Anyway, I've been doing some -*test*-('")s while bug fixing and here are my findings: :arrow: What ARE view angles? A view angle is the integer value that tells the engine which way a character is currently facing. It is represented by a number 1-8 which correspond with clockwise 45 degree increments. HOWEVER, a view angle is only relevant to the number of *illustrated* facing angles a sprite has... So, in the case of your hero character who may have a full set of 8 walk, talk, and stand cycles, a number 1-8 applies. However, in the case of a room sprite which will only get mirrored to depict two directions, all that matters is that a left or right facing angle is specified. So, if you want your sprite to face right (not get mirrored), any number 1-5 will achieve that. If the sprite should mirror left, any number 6-8 will work. That hits upon another good point... the core equivelants. 1-5 = right = NO mirroring 6-8 = left = mirroring Mirroring versus no mirroring might be a better way to think of view angles. The engine assumes that all artwork is illustrated facing right. So, if you were to illustrate a sprite facing left and give it a view angle of "6" (which is incorrect), then it would get flipped right while animating since the engine is assuming it was *illustrated facing right* and the view angle of "6" tells it to face left. This accounts for the long history of reports that have come in concerning NPCs mirroring while delivering dialogue. So, if you have a left facing sprite, do one of two things: A) Illustrate the sprite facing left and give it a view angle of 1-5, or... B) Illustrate the sprite facing right, mirror it in the editor, and give it a view angle of 6-8. :arrow: Using the Editor's "view" field The v0.8b Editor now has a "view" field that can be assigned for each room sprite. This assigns the default directional value that will be applied to the sprite. This directional value will be taken into account when the sprite is animated, and will attempt to assign animations or mirror the sprite accordingly. Now, I made a mistake in the Editor here. I set "0" as the default value of that field which is NOT a valid view angle. Most developers are just going with the default I assume. Go figure, the app is flaking out upon animation prompts and not responding correctly with that zero in place. I will change that default value to "1" in the next release of the Editor. In the meantime, update any sprites in your project that will be targeted by animation prompts as follows... And I have to go to be. This is a massive topic and I'm trying to sort out the facts as I write them. I'll continue detailing this post in the future, but in the meantime, I'm calling it a night.


Forumer™ is Voted #1 Free Forum Hosting provider
Build your own community today with the largest message board hosting company.