def load_texture(self, name): print('App::load_texture("romfs:/%s.png")' % name) png = img.load_png(open('romfs:/%s.png' % name, 'rb')) print('Loaded: %s' % repr(png[0:3])) tex = sf2d.Texture(png[0], png[1], data=png[3]) print('Texture created') del png print('png data deleted') return tex
import sf2d import img def frame(): gfx.flush_buffers() gfx.swap_buffers() gsp.wait_for_vblank() sf2d.init() sf2d.set_clear_color(sf2d.rgba8(255, 0, 0, 255)) console.init(gfx.SCREEN_BOTTOM) png = img.load_png(open('/test.png', 'rb')) tex = sf2d.Texture(png[0], png[1], sf2d.TEXFMT_RGBA8, sf2d.PLACE_RAM, png[3]) x = 0 y = 0 while apt.main_loop(): hid.scan_input() if hid.keys_down() & hid.KEY_START: break held = hid.keys_held() if held & hid.KEY_DPAD_RIGHT: x += 1 elif held & hid.KEY_DPAD_LEFT:
from citrus import * import sf2d import img sf2d.init() ndsp.init() console.init(gfx.SCREEN_BOTTOM) print('Loading tex_yay3ds.png') png = img.load_png(open('/tex_yay3ds.png', 'rb')) print('Success! (%dx%d)' % (png[0], png[1])) print('\nCreating Texture (tex_3ds)') tex_yay3ds = sf2d.Texture(png[0], png[1], data=png[3]) print('Success! %s' % tex_yay3ds) del png print('\nLoading tex_shit.png') png = img.load_png(open('/tex_shit.png', 'rb')) print('Success! (%dx%d)' % (png[0], png[1])) print('\nCreating Texture (tex_shit)') tex_shit = sf2d.Texture(png[0], png[1], data=png[3]) print('Success! %s' % tex_shit) del png ndsp.set_output_mode(ndsp.OUTPUT_MONO) ndsp.set_output_count(2) hello = ndsp.Sound(open('/hello.wav', 'rb')) goal = ndsp.Sound(open('/goal.wav', 'rb')) channel1 = ndsp.Channel(0) channel1.set_interpolation(ndsp.INTERP_POLYPHASE)
from citrus import * import sf2d import img def frame(): gfx.flush_buffers() gfx.swap_buffers() gsp.wait_for_vblank() sf2d.init() sf2d.set_clear_color(sf2d.rgba8(255, 0, 0, 255)) console.init(gfx.SCREEN_BOTTOM) png = img.load_png(open('/test.png', 'rb')) tex = sf2d.Texture(png[0], png[1], sf2d.TEXFMT_RGBA8, sf2d.PLACE_RAM, png[3]) x = 0 y = 0 while apt.main_loop(): hid.scan_input() if hid.keys_down() & hid.KEY_START: break held = hid.keys_held() if held & hid.KEY_DPAD_RIGHT: x += 1 elif held & hid.KEY_DPAD_LEFT: x -= 1
def __init__(self): sf2d.init() console.init(gfx.SCREEN_BOTTOM) self.bg_loader = img.load_png(open('romfs:/bgtest.png', 'rb'), background=True)
def load_texture(self, name): png = img.load_png(open('romfs:/netload_assets/%s.png' % name, 'rb')) tex = sf2d.Texture(png[0], png[1], data=png[3]) del png return tex