Skip to content

Instantly share code, notes, and snippets.

@endrift
Created October 15, 2016 01:22
Show Gist options
  • Save endrift/752230729cbf2e29192dbe2c4a5e86c2 to your computer and use it in GitHub Desktop.
Save endrift/752230729cbf2e29192dbe2c4a5e86c2 to your computer and use it in GitHub Desktop.
mGBA Python bindings example
from mgba import core,image
c=core.loadPath('ruby.gba')
i=image.Image(*c.desiredVideoDimensions())
c.setVideoBuffer(i)
c.reset()
for x in range(800): c.runFrame()
with open("out.png", "w") as f: i.savePNG(f)
import mgba.core
import mgba.image
core = mgba.core.loadPath('ruby.gba')
screen = mgba.image.Image(*core.desiredVideoDimensions())
core.setVideoBuffer(screen)
core.reset()
for i in range(800):
core.runFrame()
with open("out.png", "w") as f:
screen.savePNG(f)
@Jourdelune
Copy link

Jourdelune commented May 24, 2021

How can I set the width and height of the game ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment