gamesrightmeow / playbit Goto Github PK
View Code? Open in Web Editor NEWPlaybit is a framework for creating cross-platform Playdate games from a single Lua codebase.
License: MIT License
Playbit is a framework for creating cross-platform Playdate games from a single Lua codebase.
License: MIT License
All language server plugins mark preprocessor blocks and import lines as errors, since they're not actually part of native lua.
Might be able to configure this plugin to work correctly? Need to at least treat imports and preprocessors blocks as comments so that they aren't picked up as syntax errors.
The cap-to-bmfont converted currently doesn't support non-ascii chars. Detecting non-ascii chars and extracting them from kerning pairs was a bit tricky, so opted to skip it when I did the first implementation.
Using the Rains-1x font from the SDK:
local font = playdate.graphics.font.new("fonts/font-rains-1x")
local width = font:getTextWidth("Lorem ipsum dolor sit amet, consectetur")
print(width)
Playdate = 311
Love2D = 312
I believe this is an issue in Love2d where that it appends some extra padding from getWidth(str). Need to find a way to control this, or come up with some hacky workaround...
Lua doesn't have a native way to detect the user's system. My workaround is rather hacky: run a command and confirm its output matches what's expected for that platform.
Windows and Linux (Ubuntu at least) are currently working, but I don't have access to a Mac to implement support.
Lines 7 to 21 in 27fc7af
I've been taking a look at implementing CoreLibs/object
, as my game makes pretty heavy use of it. As far as I can see, there's nothing that's really specific to playdate in the CoreLibs implementation, aside from a couple places that use +=
. I've replaced those two lines so that it'd work in Love, and just straight up copied it into playbit, and that seems to work, though I'm not really sure if that's what we'd want/are entitled to do given that the file is (c) Playdate, and there's this particular clause of the SDK License.
You will not:
...
- Use the SDK to develop applications for other platforms or to develop another SDK, without express written permission from Panic.
Though I'm not sure how it could really be reimplemented in any meaningful way that isn't just... rewording the existing CoreLibs implementation.
This will require modifying the shader to support drawing with a dither algo.
Some resources:
Playbit currently executes all game code within love.draw()
. The downside to this is any called made outside of playdate.update()
don't work in Love2d (but work on Playdate). Using a custom love.run()
handler should fix this: https://love2d.org/wiki/love.run
Playdate has a synth library. Would be nice to support this on the Love2d side since it would reduce game sizes when not using WAVs. Tricky part is getting synths to match the device.
Love2d doesn't support this out of the box, but this project might be a good starting point: https://github.com/superzazu/denver.lua
Currently calls to playdate.graphics.setDrawMode()
affect all future draw calls, regardless of the context their drawn to. This isn't how it works on Playdate; it seems to only apply to the current context.
Currently playbit requires external tools (ffmeg, aseprite, etc) to be added to the user's path to work. This isn't ideal for everyone - some alternative options that should be explored:
Since Lua doesn't have a native way to read dimensions of images, the fnt-to-bmfont tool make a hacky assumption based on a quirk of Caps:
playbit/tools/caps-to-bmfont.lua
Lines 158 to 172 in 27fc7af
Maybe use a command line tool? Image Magick's identify might do the trick. Though this will add another CLI dependency.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.