Exemplo n.º 1
0
    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
Exemplo n.º 2
0
    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
Exemplo n.º 3
0
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:
Exemplo n.º 4
0
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)
Exemplo n.º 5
0
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
Exemplo n.º 6
0
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)
Exemplo n.º 7
0
    def __init__(self):
        sf2d.init()

        console.init(gfx.SCREEN_BOTTOM)

        self.bg_loader = img.load_png(open('romfs:/bgtest.png', 'rb'), background=True)
Exemplo n.º 8
0
    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