All Projects → rm-code → screenmanager

rm-code / screenmanager

Licence: Zlib license
Stackable Screen/State Management for the LÖVE framework.

Programming Languages

lua
6591 projects

Projects that are alternatives of or similar to screenmanager

vue-class-state
面向对象风格的vue状态管理
Stars: ✭ 14 (-51.72%)
Mutual labels:  state-management
vudu
GUI based in-game debugging system for LÖVE
Stars: ✭ 21 (-27.59%)
Mutual labels:  love2d
vana
Observe your immutable state trees 🌲👀 (great with React)
Stars: ✭ 24 (-17.24%)
Mutual labels:  state-management
flutter-provider-architecture
⚖️ A Flutter Architecture for small/medium/large/big large scale using Provider as State Management with Get It!
Stars: ✭ 81 (+179.31%)
Mutual labels:  state-management
vuse-rx
Vue 3 + rxjs = ❤
Stars: ✭ 52 (+79.31%)
Mutual labels:  state-management
rematch
The Redux Framework
Stars: ✭ 8,340 (+28658.62%)
Mutual labels:  state-management
react-context
(つ°ヮ°)つ Understanding React Context
Stars: ✭ 11 (-62.07%)
Mutual labels:  state-management
Accounting
A simple accounting app that provides basic additions, deletions, modifications, and provides a simple summary page, which is implemented by using MVI pattern.
Stars: ✭ 30 (+3.45%)
Mutual labels:  state-management
react-state
React-State - Superpowers for managing local and reusable state in React
Stars: ✭ 14 (-51.72%)
Mutual labels:  state-management
onli-reducer
⚛️ One line reducer. State management without boilerplate.
Stars: ✭ 31 (+6.9%)
Mutual labels:  state-management
grand central
State-management and action-dispatching for Ruby apps
Stars: ✭ 20 (-31.03%)
Mutual labels:  state-management
xoid
Framework-agnostic state management library designed for simplicity and scalability ⚛
Stars: ✭ 96 (+231.03%)
Mutual labels:  state-management
magnetar
A framework-agnostic syncing solution that auto-connects any DB/API with your local data store and has optimistic-UI built in 🌟
Stars: ✭ 36 (+24.14%)
Mutual labels:  state-management
Cyanic
Declarative, state-driven UI framework
Stars: ✭ 32 (+10.34%)
Mutual labels:  state-management
service-tree
[ABANDONED] A tree that stores services in its node for a given key, and allows traversing them.
Stars: ✭ 33 (+13.79%)
Mutual labels:  state-management
random-users-details
Random Users details in flutter from randomusers api
Stars: ✭ 14 (-51.72%)
Mutual labels:  state-management
mobius.kt
Kotlin Multiplatform framework for managing state evolution and side-effects
Stars: ✭ 39 (+34.48%)
Mutual labels:  state-management
swr-internal-state
Use SWR to manage app's internal state
Stars: ✭ 32 (+10.34%)
Mutual labels:  state-management
ng-effects
Reactivity system for Angular. https://ngfx.io
Stars: ✭ 46 (+58.62%)
Mutual labels:  state-management
RetroLove
A collection of simple games built with the LOVE game framework.
Stars: ✭ 13 (-55.17%)
Mutual labels:  love2d

ScreenManager

Version LOVE License

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 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).

-- main.lua

local ScreenManager = require('lib.ScreenManager')

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

    ScreenManager.init(screens, 'main')
end

function love.draw()
    ScreenManager.draw()
end

function love.update(dt)
    ScreenManager.update(dt)
end

Note how MainScreen inherits from Screen.lua. This isn't mandatory, but recommended since Screen.lua already has templates for most of the callback functions.

-- MainScreen.lua

local Screen = require('lib.Screen')

local MainScreen = {}

function MainScreen.new()
    local self = Screen.new()

    local x, y, w, h = 20, 20, 40, 20

    function self:draw()
        love.graphics.rectangle('fill', x, y, w, h)
    end

    function self:update(dt)
        w = w + 2
        h = h + 1
    end

    return self
end

return MainScreen

Documentation

An online documentation is available here.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].