The Playdate console uses the Sharp Memory Display 2.7".
- memory-table-22-22.png - Sprite map of all icons
- See Lua or C mappings with example code.
Why would I include the entire sprite map if I only need a few icons?
Ease of developer use. The sprite map is small due to the monochrome color pallet. Each icon is read off flash storage as neccessary using little resources.
Copy the two files in this folder to your project.
icon.lua
tosource/icon.lua
memory-table-22-22.png
tosource/images/memory-table-22-22.png
Currently the icon class defines:
local icon1 = Icon(x, y, iconIndex)
icon1:setIcon(iconIndex)
- Inherits Sprite so has all functions
icon1:moveTo(x, y)
IconAlert
,IconAccount
, etc...
import "CoreLibs/object"
import "CoreLibs/graphics"
import "CoreLibs/sprites"
import "icon"
local pd <const> = playdate
local gfx <const> = pd.graphics
local icon3 = Icon(224, 120, IconAlphaA)
local function initialize()
gfx.setColor(gfx.kColorBlack)
local icon1 = Icon(180, 120, IconDevice)
icon1:add()
local icon2 = Icon(202, 120, IconArrowRight)
icon2:add()
icon3:add()
end
initialize()
function playdate.update()
gfx.sprite.update()
if playdate.buttonIsPressed(playdate.kButtonA) then
local i = math.random(1, 200)
icon3:setIcon(i)
print('Random', i)
end
end
I don't know C... so let me know what to generate.