Hello guest, if you read this it means you are not registered. Click here to register in a few simple steps, you will enjoy all features of our Forum.
Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pygame.init help
#1
pygame.init() the internet tells me this is initializing a module. What does that mean?
Quote
#2
http://pygame.org/docs/tut/ImportInit.html

init initializes all the modules for you in one line instead of doing this in every game. At the same time it initializes the modules in correct order. For example some platforms require mixer to initialize after display, etc.
pygame.font.init()
pygame.display.init()
pygame.mixer.init()
pygame.joystick.init()
pygame.freetype.init()
pygame.midi.init()
pygame.cdrom.init()
pygame.scrap.init()

If you are making just an mp3 player, you dont need a display, so you dont have to initialize every module, you can just do pygame.mixer.init() for example. Or you may need to give specific values
pygame.mixer.init(frequency=22050, size=-16, channels=2, buffer=4096)

As for what init actually does you can look at the source

mixer.init
https://bitbucket.org/pygame/pygame/src/...ixer.c-315
nilamo likes this post
*Describe the environment in which it occurs.                                    *Describe the symptoms of your problem clearly.
*Describe the research you did to try and understand the problem.      *Describe the goal, not the step. 
*Use meaningful, specific subject headers                                          *Write in clear, grammatical, correctly-spelled language
*Describe the problem's symptoms, not your guesses                         *Describe your problem's symptoms in chronological order
*Describe the diagnostic steps you took to try and pin down the problem yourself.
*Describe any possibly relevant recent changes in your computer or software configuration. 
*Provide a way to reproduce the problem in a controlled environment.
Quote
#3
Ah I had the same question. Thanks!
nilamo likes this post
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  [PyGame] How do you get PyGame? SpeedyZapGaming 16 990 8 hours ago
Last Post: JamieVanCadsand
  [Pygame] Avoid SentDex pygame tutorials georgecoopers 1 406 Apr-09-2017, 12:40 PM
Last Post: metulburr

Forum Jump:


Users browsing this thread: 1 Guest(s)