So ive spent the best part of today trying to figure this out but I am having no luck, so thought id ask the pro'sÂ
Â
I have added 8 frames to my game for everything, apart from I would like to use only 3x4 frame sprite in for _idle (To save on adding the extra frames and them not being used).
Â
I have tried a few modifications to Entity.cs, but I can not seem to get it right, as I get warnings and errors or it just does not work.
Â
These are my sprites:
Â
Normal Sprite
Â
Idle Sprite
Â
I tried to add a else if to the Draw function:
Â
if (SpriteAnimation == SpriteAnimations.Idle)
{
srcRectangle = new FloatRect(
3 * (int)texture.GetWidth() / 3, d * (int)texture.GetHeight() / 4,
(int)texture.GetWidth() / 3, (int)texture.GetHeight() / 4
);
}
But It doesnt work. I added this above "if (SpriteAnimation == SpriteAnimations.Normal)"
Â
Any ideas where im going wrong? My knowledge of C# is very limited and I am still learning. So I mainly use what I can see in the code already a minic it (Noob way :P)
Question
Ainz Ooal Gown
Hi All,
Â
So ive spent the best part of today trying to figure this out but I am having no luck, so thought id ask the pro'sÂ
Â
I have added 8 frames to my game for everything, apart from I would like to use only 3x4 frame sprite in for _idle (To save on adding the extra frames and them not being used).
Â
I have tried a few modifications to Entity.cs, but I can not seem to get it right, as I get warnings and errors or it just does not work.
Â
These are my sprites:
Â
Normal Sprite
Â
Idle Sprite
Â
I tried to add a else if to the Draw function:
Â
But It doesnt work. I added this above "if (SpriteAnimation == SpriteAnimations.Normal)"
Â
Any ideas where im going wrong? My knowledge of C# is very limited and I am still learning. So I mainly use what I can see in the code already a minic it (Noob way :P)
Â
Thanks
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now