Added: 2 years ago
From: metalx1000
Views: 1,396
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (13)

Sign In or Sign Up now to post a comment!
  • i made a paint program and i want it so that when you hit a key it starts recording and then you can see a screen recording of what you did, but if i use screenshots it will just be a bunch of .png files, how can i make a mp4 file or something like that

  • @maradona640: Although you should be able to do it with python itself, I don't know how.

    but you can easily call something like FFMPEG or Mencoder from your python code.

    here is an example:

    ffmpeg -f image2 -i image%d.png video.mpg

  • just as a recommend, how does it sound to make the event loop such as this,

    for event in pygame.event.get(): if event.type == KEYDOWN: if event.key == [Key]  elif event.ket == [Key] elif event.type == MOUSTBUTTONDOWN: if ... [Same prototype as top]

    such that, it would be easier to group the KEYDOWN, KEYUP and other button signals and the code will be less self repeater since we would only write KEYDOWN for 1 time. Just a suggestion!

  • @himhim123: Yup, it's a good idea and some times I do that.

  • yesss! a fellow mint user!

  • You should use while True, not while 1 :D

  • @deamon689: have been using while True instead of while 1 lately. But, I've just been doing it to back things clearer i my code. Why do you recommend doing it? does it make a difference?

  • @metalx1000 Its just a style issue that the designers of python prefer. Python didn't get bool statements till later on hence the use of 1 and 0, but Now we have True and False if makes things neater to keep up with the times.

  • Comment removed

  • Another good tutorial!

    why does pygame like .png files so much and not ther formats like .jpeg, .gif etc

  • @judasvigilante: PyGame works works with jpg and gif. PNG have an advantage over jpg because PNG has a transparent layer. Although, you can make a certian color transparent in JPEG files with Pygame.

  • @metalx1000

    Thanks for the prompt reply and for answe

    ring my query, I get it now!

    Great tutorials BTW.

    Regards, paul

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more