Skip to content

Commit

Permalink
Merge branch 'release/1.8.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
rm-code committed Jan 18, 2017
2 parents 6a7bfd9 + 501e8a0 commit 7138ebe
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 8 deletions.
16 changes: 16 additions & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
files['.luacheckrc'].global = false
std = 'max+busted'

globals = {
'love',
'getVersion',
'getTitle'
}

exclude_files = {
'./lua_install/*'
}

ignore = {
'/self'
}
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2014 - 2016 Robert Machmer
Copyright (c) 2014 - 2017 Robert Machmer

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
Expand Down
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
#ScreenManager

[![Version](https://img.shields.io/badge/Version-1.8.0-blue.svg)](https://github.com/rm-code/screenmanager/releases/latest)
[![LOVE](https://img.shields.io/badge/L%C3%96VE-0.10.0-EA316E.svg)](http://love2d.org/)
[![License](http://img.shields.io/badge/Licence-zlib-brightgreen.svg)](LICENSE.md)

The ScreenManager library is a state manager at heart which allows some nifty things, like stacking multiple screens on top of each other.

It also offers hooks for most of LÖVE's callback functions. Based on the type of callback the calls are rerouted to either only the active screen (love.keypressed, love.quit, ...) or to all screens (love.resize, love.visible, ...).

## Example

> For a more complete example check out the [example branch](https://github.com/rm-code/screenmanager/tree/example) in this repository.
This is a simple example of how the ScreenManager should be used (note: You will have to change the paths in the example to fit your setup).

```lua
-- main.lua

local ScreenManager = require('lib/ScreenManager');
local ScreenManager = require('lib.ScreenManager');

function love.load()
local screens = {
main = require('src/screens/MainScreen');
main = require('src.screens.MainScreen');
};

ScreenManager.init(screens, 'main');
Expand All @@ -34,7 +40,7 @@ Note how MainScreen inherits from Screen.lua. This isn't mandatory, but recommen
```lua
-- MainScreen.lua

local Screen = require('lib/Screen');
local Screen = require('lib.Screen');

local MainScreen = {};

Expand Down
2 changes: 1 addition & 1 deletion Screen.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--===============================================================================--
-- --
-- Copyright (c) 2014 - 2016 Robert Machmer --
-- Copyright (c) 2014 - 2017 Robert Machmer --
-- --
-- This software is provided 'as-is', without any express or implied --
-- warranty. In no event will the authors be held liable for any damages --
Expand Down
6 changes: 3 additions & 3 deletions ScreenManager.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--===============================================================================--
-- --
-- Copyright (c) 2014 - 2016 Robert Machmer --
-- Copyright (c) 2014 - 2017 Robert Machmer --
-- --
-- This software is provided 'as-is', without any express or implied --
-- warranty. In no event will the authors be held liable for any damages --
Expand All @@ -21,7 +21,7 @@
--===============================================================================--

local ScreenManager = {
_VERSION = '1.8.0',
_VERSION = '1.8.1',
_DESCRIPTION = 'Screen/State Management for the LÖVE framework',
_URL = 'https://github.com/rm-code/screenmanager/',
};
Expand Down Expand Up @@ -193,7 +193,7 @@ end
-- delay between key repeats depends on the
-- user's system settings.
--
function ScreenManager.keypressed( key, scancode, isrepeat )
function ScreenManager.keypressed( key, scancode, isrepeat )
ScreenManager.peek():keypressed( key, scancode, isrepeat );
end

Expand Down

0 comments on commit 7138ebe

Please sign in to comment.