Git Product home page Git Product logo

modrun's Introduction

Features

The library adds the following new features:

  • An FPS limiter
  • Ability to add and enable/disable event callbacks
  • Short-circuiting subsequent callbacks, by returning true from them, e.g. to capture input to UI
  • Maintains one copy of the module only, preventing errors should multiple libraries include their own copy

The library adds the following new events:

  • pre_quit() - An event that runs before quit, and can be used to stop the program from terminating
  • dispatch(event, ...) - A dispatch event, to which all events are sent
  • pre_update(dt) - An event that runs before love.update()
  • post_update(dt) - An event that runs after love.update()
  • postprocess(draw_dt) - A second draw event, called after draw, can be used to draw overlay, profiling info, etc.

The library provides the following functions:

  • modrun.setup() - Sets modrun up, replacing the original love.run
  • modrun.registerEventType(event, fail_if_exists) - Registers a new event, issues a warning, or optionally an error, if the event already exists
  • modrun.addCallback(event, callback, self_obj, on_error) - Registers a new callback for an event, optionally includes an error handler, and an object to be passed as "self"
  • modrun.removeCallback(event, callback) - Removes a previously registered callback
  • modrun.enableCallback(event, callback) - Enables a callback
  • modrun.disableCallback(event, callback) - Disables a callback, preventing it from being processed
  • modrun.setFramerateLimit(fps) - Set maximum FPS to the given value. Pass 0 or false to disable the limit. Only applies if vsync is disabled
  • modrun.push(event, ...) - Push an event to the queue. Essentially same as love.event.push()

For detailed documentation, check source

modrun's People

Contributors

asmageddon avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.