Skip to content

Commit 6204aec

Browse files
committed
Add lowmemory callback
1 parent 715c3aa commit 6204aec

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Screen.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ function Screen.new()
5353

5454
function self:keyreleased(key) end
5555

56+
function self:lowmemory() end
57+
5658
function self:textinput(input) end
5759

5860
function self:mousereleased(x, y, button) end

ScreenManager.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,13 @@ function ScreenManager.keyreleased(key)
198198
ScreenManager.peek():keyreleased(key);
199199
end
200200

201+
---
202+
-- Callback function triggered when the system is running out of memory on mobile devices.
203+
--
204+
function ScreenManager.lowmemory()
205+
ScreenManager.peek():lowmemory();
206+
end
207+
201208
---
202209
-- Reroute the textinput callback to the currently active screen.
203210
-- @param input

0 commit comments

Comments
 (0)