Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Gif  (Read 2455 times)

0 Members and 1 Guest are viewing this topic.

narita12

  • Newbie
  • *
  • Posts: 12
    • View Profile
    • Email
Gif
« on: November 09, 2016, 10:31:11 am »
Hello people ^^

How can I insert a Gif image?  ???

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10826
    • View Profile
    • development blog
    • Email
Re: Gif
« Reply #1 on: November 09, 2016, 11:26:17 am »
Just use the image tags [img]<url>[/img]. However make sure it's actually a GIF and not a vgif or mp4, etc.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

narita12

  • Newbie
  • *
  • Posts: 12
    • View Profile
    • Email
Re: Gif
« Reply #2 on: November 09, 2016, 01:00:17 pm »
I can't do this in a window :-\ I work with SFML Graphics header ... and I want to set a gif in my window.
P.S.: I am new xD

Hapax

  • Hero Member
  • *****
  • Posts: 3351
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Gif
« Reply #3 on: November 09, 2016, 01:58:30 pm »
eXpl0it3r's answer was to insert a GIF image into a post on the forum as your question wasn't particularly clear.

It's clear now that you want to use a GIF in a SFML-based program. The answer is to load it into a texture (or image) in the same way that you loaded a PNG image. SFML cannot load GIF animations, though; it will only load the first frame. If you require animations, you should use an image editor to copy the frames in the GIF onto a single image and change the texture rectangle of the sprite to change the frame shown (or use something like Selba Ward's Gallery Sprite ;))

P.S.: I am new xD
Welcome! :)

EDIT: fixed Selba Ward link
« Last Edit: November 09, 2016, 02:11:49 pm by Hapax »
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

narita12

  • Newbie
  • *
  • Posts: 12
    • View Profile
    • Email
Re: Gif
« Reply #4 on: November 09, 2016, 02:09:28 pm »
Thanks ^^