2D-Animationsklasse
Aus Spieleprogrammierer-Wiki
(Unterschied zwischen Versionen)
[unmarkierte Version] | [unmarkierte Version] |
Koschi (Diskussion | Beiträge) (→Pseudocode) |
Koschi (Diskussion | Beiträge) |
||
Zeile 90: | Zeile 90: | ||
{{Spoiler|'''Load_SpriteSheet((String Path,int X_Size,int Y_Size)'''| | {{Spoiler|'''Load_SpriteSheet((String Path,int X_Size,int Y_Size)'''| | ||
<sourcecode lang=cpp tab=4 > | <sourcecode lang=cpp tab=4 > | ||
+ | /* Ladefunktion für das Sprite Sheet*/ | ||
+ | |||
bool C2dAnimation::Load_SpriteSheet(String Path,int X_Size,int Y_Size) | bool C2dAnimation::Load_SpriteSheet(String Path,int X_Size,int Y_Size) | ||
{ | { | ||
Zeile 99: | Zeile 101: | ||
{{Spoiler|'''Get_CurrentFrame()'''| | {{Spoiler|'''Get_CurrentFrame()'''| | ||
<sourcecode lang=cpp tab=4 > | <sourcecode lang=cpp tab=4 > | ||
+ | /* Liefert das Aktuell gültige Sprite zurück */ | ||
+ | |||
bool C2dAnimation::Get_CurrentFrame() | bool C2dAnimation::Get_CurrentFrame() | ||
{ | { | ||
Zeile 127: | Zeile 131: | ||
{{Spoiler|'''Set_Animation(int firstframe,int lastframe,int stopframe,float frametime)'''| | {{Spoiler|'''Set_Animation(int firstframe,int lastframe,int stopframe,float frametime)'''| | ||
<sourcecode lang=cpp tab=4 > | <sourcecode lang=cpp tab=4 > | ||
+ | /* Daten der Animation Setzen */ | ||
+ | |||
bool C2dAnimation::Set_Animation(int firstframe,int lastframe,int stopframe,float frametime) | bool C2dAnimation::Set_Animation(int firstframe,int lastframe,int stopframe,float frametime) | ||
{ | { | ||
− | |||
FirstFrame = firstframe; | FirstFrame = firstframe; | ||
LastFrame = lastframe; | LastFrame = lastframe; | ||
Zeile 139: | Zeile 144: | ||
{{Spoiler|'''Animation_On(bool Value)'''| | {{Spoiler|'''Animation_On(bool Value)'''| | ||
<sourcecode lang=cpp tab=4 > | <sourcecode lang=cpp tab=4 > | ||
+ | /* Die Ein- Ausschaltfunktion der Animation */ | ||
+ | |||
bool C2dAnimation::Animation_On(bool Value) | bool C2dAnimation::Animation_On(bool Value) | ||
{ | { |
Version vom 15. Oktober 2012, 09:42 Uhr
Klicke hier, um diese Version anzusehen.