Exemplo n.º 1
0
def setup():
    global toolbar, frames

    arcadeplus.open_window(WIDTH, HEIGHT, "AnimationCreator")
    arcadeplus.set_background_color(arcadeplus.color.WHITE)
    scheduling_update_time = 0.01666666666  # float value is same as 1/60
    arcadeplus.schedule(on_update, scheduling_update_time)

    # Create Vertex Buffer Object (VBO) shape lists
    frames.append(arcadeplus.ShapeElementList())
    toolbar = arcadeplus.ShapeElementList()

    # Override arcade window methods
    window = arcadeplus.get_window()
    window.on_draw = on_draw
    window.on_key_press = on_key_press
    window.on_key_release = on_key_release
    window.on_mouse_press = on_mouse_press
    window.on_mouse_release = on_mouse_release
    window.on_mouse_drag = on_mouse_drag

    # Render toolbar
    render_toolbar_dividers()
    render_toolbar_shapes()
    render_toolbar_colors()
    render_toolbar_icons()
    render_toolbar_text()

    arcadeplus.run()
Exemplo n.º 2
0
def main():
    # Open up our window
    arcadeplus.open_window(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
    arcadeplus.set_background_color(arcadeplus.color.WHITE)

    # Tell the computer to call the draw command at the specified interval.
    arcadeplus.schedule(on_draw, 1 / 80)

    # Run the program
    arcadeplus.run()
def setup():
    arcade.open_window(WIDTH, HEIGHT, "TOHACKS SARS COV-2 Model")
    arcade.set_background_color(arcade.color.LIGHT_STEEL_BLUE)
    arcade.schedule(update, 1 / 60)

    window = arcade.get_window()
    window.on_draw = on_draw
    window.on_mouse_press = on_mouse_press
    window.on_mouse_release = on_mouse_release
    window.on_mouse_motion = on_mouse_motion

    arcade.run()
def setup():
    arcade.open_window(WIDTH, HEIGHT, "TOHACKS SARS COV-2 Model")
    arcade.set_background_color(arcade.color.WHITE)
    arcade.schedule(update, 1 / 60)

    # Override arcade window methods
    window = arcade.get_window()
    window.on_draw = on_draw
    window.on_key_press = on_key_press
    window.on_key_release = on_key_release
    window.on_mouse_press = on_mouse_press
    window.on_mouse_release = on_mouse_release
    window.on_mouse_motion = on_mouse_motion

    arcade.run()
Exemplo n.º 5
0
    def __init__(self):
        super().__init__(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)

        # Set the working directory (where we expect to find files) to the same
        # directory this .py file is in. You can leave this out of your own
        # code, but it is needed to easily run the examples using "python -m"
        # as mentioned at the top of this program.
        file_path = os.path.dirname(os.path.abspath(__file__))
        os.chdir(file_path)

        arcadeplus.set_background_color(arcadeplus.color.BLACK)
        self.emitters = []
        self.frametime_plotter = FrametimePlotter()

        self.launch_firework(0)
        arcadeplus.schedule(self.launch_spinner, 4.0)

        stars = arcadeplus.Emitter(
            center_xy=(0.0, 0.0),
            emit_controller=arcadeplus.EmitMaintainCount(20),
            particle_factory=lambda emitter: AnimatedAlphaParticle(
                filename_or_texture=random.choice(STAR_TEXTURES),
                change_xy=(0.0, 0.0),
                start_alpha=0,
                duration1=random.uniform(2.0, 6.0),
                mid_alpha=128,
                duration2=random.uniform(2.0, 6.0),
                end_alpha=0,
                center_xy=arcadeplus.rand_in_rect(
                    (0.0, 0.0), SCREEN_WIDTH, SCREEN_HEIGHT)))
        self.emitters.append(stars)

        self.cloud = arcadeplus.Emitter(
            center_xy=(50, 500),
            change_xy=(0.15, 0),
            emit_controller=arcadeplus.EmitMaintainCount(60),
            particle_factory=lambda emitter: AnimatedAlphaParticle(
                filename_or_texture=random.choice(CLOUD_TEXTURES),
                change_xy=(_Vec2(arcadeplus.rand_in_circle(
                    (0.0, 0.0), 0.04)) + _Vec2(0.1, 0)).as_tuple(),
                start_alpha=0,
                duration1=random.uniform(5.0, 10.0),
                mid_alpha=255,
                duration2=random.uniform(5.0, 10.0),
                end_alpha=0,
                center_xy=arcadeplus.rand_in_circle((0.0, 0.0), 50)))
        self.emitters.append(self.cloud)
Exemplo n.º 6
0
def test_window():
    import arcadeplus
    width = 800
    height = 600
    title = "My Title"
    resizable = True
    arcadeplus.open_window(width, height, title, resizable)

    arcadeplus.set_background_color(arcadeplus.color.AMAZON)
    w = arcadeplus.get_window()
    assert w is not None

    # Make sure the arguments get passed to the window
    assert w.width == width
    assert w.height == height
    assert w.caption == title
    assert w.resizeable is resizable

    arcadeplus.set_window(w)

    p = arcadeplus.get_projection()
    assert p is not None

    v = arcadeplus.get_viewport()
    assert v[0] == 0
    # The lines below fail. Why?
    # assert v[1] == width - 1
    assert v[2] == 0
    # assert v[3] == height - 1

    arcadeplus.start_render()
    arcadeplus.finish_render()

    def f():
        pass

    arcadeplus.schedule(f, 1 / 60)

    arcadeplus.pause(0.01)

    arcadeplus.close_window()

    arcadeplus.open_window(width, height, title, resizable)
    arcadeplus.quick_run(0.01)
Exemplo n.º 7
0
def setup():
    create_birds()
    arcadeplus.schedule(update, 1 / 60)
    arcadeplus.run()
Exemplo n.º 8
0
def setup():
    arcade.set_background_color(arcade.color.WHITE)
    arcade.schedule(update, 1 / 60)
    arcade.run()