IMG_CreateAnimatedCursor(3)

πŸ“¦
version 3.4.8 Β· 5 versions
, in fedora 43, fedora 44

πŸ’– IMG_CreateAnimatedCursor(3) πŸ’–

okay bestie, gather round, because this one is literally from the SDL_image3 FUNCTIONS collection and it's giving main character energy fr fr. You know how a regular cursor is just, like, one static little guy? Yeah. Not this one. This one moves. ✨


🌸 NAME 🌸

IMG_CreateAnimatedCursor β€” create an animated cursor from an animation. yes really. a cursor that ANIMATES. the way that this exists?? obsessed. πŸ¦‹


✨ SYNOPSIS ✨

#include <SDL3_image/SDL_image.h>

SDL_Cursor * IMG_CreateAnimatedCursor(IMG_Animation *anim, int hot_x, int hot_y);

so you pull in the header, and then you hit it with an IMG_Animation *, plus two ints for the hotspot, and boom πŸ’₯ β€” you get back a SDL_Cursor *. simple. clean. iconic.


πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • anim β€” the animation you wanna turn into an animated cursor. that's the whole vibe source, no cap.
  • hot_x β€” the x position of the cursor hot spot. yk, the pixel that's actually "doing the clicking."
  • hot_y β€” the y position of the cursor hot spot. its partner in crime. πŸ’…

🫢 RETURN VALUE 🫢

On success you get the brand new cursor back. On failure you get NULL 😭 β€” and then you gotta call SDL_GetError() for more info, because she will tell you exactly what went wrong. no guessing, just facts.


🌈 AVAILABILITY 🌈

This function has been available since SDL_image 3.4.0. so if you're on something older, sorry babe, you're not getting this one. πŸ’€


πŸ‘‘ SEE ALSO πŸ‘‘

like, if you need to make an animation first before you can turn it into a cursor… start there. iykyk. πŸ”₯


and that's the whole page, bestie πŸ§šπŸ’œ β€” brought to you by SDL_image 3.4.8, from the SDL_image crew. go make something that sparkles. periodt. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from