1 registered members (TipmyPip),
18,449
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Sprite Animation
#443304
07/12/14 22:04
07/12/14 22:04
|
Joined: Aug 2013
Posts: 39
Adulescens
OP
Newbie
|
OP
Newbie
Joined: Aug 2013
Posts: 39
|
Hallo, ich habe das Handbuch gründlich durchgelesen und habe nirgends gelesen, wie man eine 2D Animation vor oder auf einen Panel schiebt. Immer wenn ich eine Sprite (also 2D) Animation im Skript starte, erscheint zwar die Animation, aber sobald ich ein Panel hinzufüge, ist die Animation immer hinter dem Panel und ich las im Handbuch nirgends, wie man die Animation vor das Panel bekommt. Gibt es hierfür eine Art Layer-Funktion für die Sprite Animation? Oder kann man sie irgendwie an ein Panel anheften? Danke  Lg
|
|
|
Re: Sprite Animation
[Re: Adulescens]
#443306
07/13/14 07:11
07/13/14 07:11
|
Joined: Apr 2005
Posts: 1,988 Canadian, Eh
DLively
Serious User
|
Serious User
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
|
Im not sure I understand what you are trying to achieve.. Are you trying to animate a sprite, that is behind a panel? Panels are generally fixed to the camera, where sprites are placed inside the virtual realm of awesome. Thus, this creates it so that your sprite will be behind the panel. What you need to achieve is either a loop which controls the panel you are trying to animate, and each frame (or however often it changes) have it change to the next animation, looping itself.
function animate_panel(){
if(panel_number == 0) reset(panel4, SHOW);set(panel1,SHOW);return;
if(panel_number == 1) reset(panel1, SHOW);set(panel2,SHOW);return;
if(panel_number == 2) reset(panel2, SHOW);set(panel3,SHOW);return;
if(panel_number == 3) reset(panel3, SHOW);set(panel4,SHOW);return;
}
Im sure there is a better way to do this, but this is an idea for you to try  I Really hope this is the answer you were looking for 
|
|
|
Re: Sprite Animation
[Re: DLively]
#443310
07/13/14 09:21
07/13/14 09:21
|
Joined: Aug 2013
Posts: 39
Adulescens
OP
Newbie
|
OP
Newbie
Joined: Aug 2013
Posts: 39
|
Yea I want to set a sprite animation in front of a Panel, but what you said is another good way to show an animation Thank you for the code! I'll try it 
Last edited by Adulescens; 07/13/14 09:24.
|
|
|
Re: Sprite Animation
[Re: Adulescens]
#443336
07/13/14 22:22
07/13/14 22:22
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
That's not exactly how floor() works, sorry DLively. floor and ceiling are two mathematical functions, see here: http://en.wikipedia.org/wiki/Floor_and_ceiling_functionsThus the floor() function behaves as follows: "floor(x) is the largest integer not greater than x", which means: floor(3.41) = 3; floor(3.99) = 3; floor(4) = 4; floor(-1) = -1; floor(-1.2) = -2; floor(-1.9) = -2;
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
|