MIX API reference
=================

* [MIXContext](#MIXContext) - core module interface. Frame update.
* [Draw module](#draw-module) - rendering and drawing related functions.
* [Input module](#input-module) - keyboard, mouse, touch and gamepad support.
* [Loader module](#loader-module) - asset loading.
* [Act module](#act-module) - time-based functions.
* [Ease module](#ease-module) - easing functions.
* [Texture object](#texture-object) - object used for textures.
* [Sound object](#texture-object) - object used for sound.
* [Shader object](#texture-object) - object used for shaders.
* [Extra](#extra) - extra interfaces.

## MIXContext

### `mix.run(assets, init, frame)`
All-in-one function for loading assets, initializing function and frame. Check [usage](https://github.com/fserb/mix/blob/master/docs/usage.md) documentation for more info on how this relates to other ways of using **mix**.

`assets` is a list of asset files to load. Passed to [`mix.load`](#loader-module). Check there for supported files.

`init` function that gets called once all assets are loaded. Check [`mix.load`](#loader-module) returned promise for more info.

`frame` function to be called every frame to draw/update.

`mix.run` is a API sugar, where `mix.run(assets, init frame)` is equivalent to:

```js
this.load(load).then(init).then(_ => {
  this.addEventListener("frame", ev => frame(ev.dt));
});
```
***

### `mix.fullscreen(fullscreen?)`
Sets the mix canvas to go fullscreen.

`fullscreen?` if set to `true` or `false`, forces fullscreen to be or on. If not set, `mix.fullscreen` will switch from whatever is the current state.

***

### `mix.shader(fragmentShader?)`
***

### `mix.createImage(filename, mipmap = false, wrapX = false, wrapY = false)`
Creates a image texture from the filename. Check [Texture object](#texture-object)
for the remaining parameters.

Image textures have a `ready` attribute that is a Promise that gets executed
once the texture is properly loaded.

***

### `mix.createCanvas(width, height, minfilter = null, magfilter = null, context = "2d")`
Creates a canvas-backed texture. Check [Texture object](#texture-object)
for the remaining parameters.

A canvas texture has a `ctx` attribute that corresponds to the `context` supplied.
Using this `ctx` will trigger the proper texture update.

***

### `mix.createSurface(width, height)`
Creates a framebuffer texture. If no size is specified, defaults to the size of
the mix canvas.

Surfaces can be used as drawing targets using [`mix.drawTo`](#draw-module).

***


## Draw module

### `mix.draw(texture, x, y, opts)`
***

## Input module

### `mix.press(keys, ...)`
***

### `mix.just(keys, ...)`
***

### `mix.mouse`
***

## Loader module

### `mix.load(url)`
***

## Act module

### `mix.act(object)`

### `Act.stop()`
***

### `Act.resume()`
***

### `Act.pause()`
***

### `Act.delay(time)`
***

### `Act.attr(attr, value, duration, ease)`
***

### `Act.set(attr, value)`
***

### `Act.incr(attr, value)`
***

### `Act.then(func)`
***

### `Act.tween(func, duration, ease)`
***


## Ease module

### `mix.ease`
***

## Texture object

## Sound object

## Shader object

## Extra

### `mix.commit()`
***

### `mix.freeze()`
***

### `frame Event`
***

### `mix.canvas`
***

### `mix.gl`
