Login to PixelPAD
Save your project by logging in or signing up.
USERNAME OR EMAIL ADDRESS
PASSWORD
Forgot my Password?
Don't have an account?
Sign Up For PixelPAD
Save your project by logging in or signing up.
EMAIL ADDRESS
PASSWORD
CONFIRM PASSWORD
I already have an account
Sign up as a Teacher
Create classrooms, and monitor your students.
SCHOOL NAME
EMAIL ADDRESS
PASSWORD
CONFIRM PASSWORD
I already have an account
  • Introduction
  • Game
  • Start-loop
  • Objects
  • Sprites
  • Animation
  • Sounds
  • Rooms
  • Input
  • Collision
  • Functions
  • Camera
  • Fps
  • Text
  • Filters
  • Multiplayer
  • Legacy

PixelPAD 2D - animation

animation(sprite: sprite, fps: int, start: int, end: int) -> animation

Example
Description
Create a new animation object from the provided sprite sheet.
Parameters
sprite
The sprite object to create the animation from. A sprite object is created from new_sprite(uri)

fps
The frame rate of the animation.

start
The frame number of the sprite sheet to start the animation from. 0 is the top left corner, with numbers increasing to the right and downwards.

end
The frame number of the sprite sheet to end the animation on. 0 is the top left corner, with numbers increasing to the right and downwards.

Return
A new animation object that plays frames from start to end at a rate of fps.

set_animation(obj: gameobject, anim: animation) -> None

Example
Description
Set the current animation of the game object obj to the animation anim. Animation will start from initial frame set in anim
Parameters
obj
The GameObject instance to set the animation for. Can use self

anim
The animation object to set.

Return
No return value

Animation

Animations are what lets us make our sprites move. To make animations you use something called a “sprite sheet”. Sprite sheets are when you take multiple sprites, put them inside of one sprite and then get the game, in this case PixelPAD2D to break the images up for us turning them into frame(s). Then once you do that you can tell the engine to animate our objects for us by looping quickly through specific frames. Check out the methods and examples below for more.
PixelPAD
About Us
Arm Build 2.8.4
Resources
Documentation
Discord
EULA
Privacy Policy
Contact Us
hello@pixelpad.io
© 2023 All Rights Reserved. PixelPAD.io
Region: us-west-1