Search found 1604 matches

by ivan
Sun Sep 27, 2020 4:54 pm
Forum: Support and Development
Topic: Love2D and HTML5 games
Replies: 2
Views: 54

Re: Love2D and HTML5 games

Tanner and Davidobot's love.js
It's still not 100% stable but will hopefully become mainstream in the future.
by ivan
Sun Sep 27, 2020 4:52 pm
Forum: Libraries and Tools
Topic: LuaPreprocess
Replies: 16
Views: 13738

Re: LuaPreprocess

Precropressing is basically one language on top of another so it's definately more complicated than just using Lua. Preprocessing bugs are notoriously hard to debug in C/C++ so I would disagree with you there.
by ivan
Sun Sep 27, 2020 11:12 am
Forum: Libraries and Tools
Topic: LuaPreprocess
Replies: 16
Views: 13738

Re: LuaPreprocess

My gut reaction is that adding a preprocessing phase to Lua unnecessarily increases the complexity. Personally, I find it easier to just hijack existing functions like so: if DEV_MODE then -- inject debug features to "print" devlog = {} local _print = print function print(sz) -- append to the the de...
by ivan
Thu Sep 24, 2020 10:53 am
Forum: Ports
Topic: Love.js - A Direct Emscripten Port
Replies: 163
Views: 157913

Re: Love.js - A Direct Emscripten Port

Right. We removed it yesterday, actually, but I just didn't regenerate the lovejs package since then. I wish I could automate that, by the way, but I saw it's not as simple as simply replacing the game.data file. Have not tested this but it looks like all of the files are the same except for index....
by ivan
Thu Sep 24, 2020 5:11 am
Forum: Ports
Topic: Love.js - A Direct Emscripten Port
Replies: 163
Views: 157913

Re: Love.js - A Direct Emscripten Port

Well done, it works fine. Just note that you don't need a quit button in the web version.
by ivan
Mon Sep 21, 2020 6:37 am
Forum: Ports
Topic: Love.js - A Direct Emscripten Port
Replies: 163
Views: 157913

Re: Love.js - A Direct Emscripten Port

Just managed to get my shaders to work with love.js and my game works perfectly https://2dengine.com/arena/ Note that in WebGL you are not allowed to initialize your externs so: extern number scale = 1; Should become: uniform float scale; D0NM, I have never noticed this before, can you please post a...
by ivan
Mon Sep 21, 2020 4:39 am
Forum: Support and Development
Topic: Creating Custom Drawables?
Replies: 5
Views: 159

Re: Creating Custom Drawables?

On an unrelated note, it would be cool if "Body" was "Drawable" for debug purposes.
by ivan
Sun Sep 20, 2020 5:14 pm
Forum: Support and Development
Topic: Creating Custom Drawables?
Replies: 5
Views: 159

Re: Creating Custom Drawables?

Not without rebuilding Love2D. Drawable is a C++ thing so you can't create C++ object from Lua. FFI won't help you in this case.
In theory you could just replace the default love.graphics.draw function with your own but it's ugly and I wouldn't recommend it.
by ivan
Sat Sep 19, 2020 3:06 pm
Forum: Ports
Topic: Love.js - A Direct Emscripten Port
Replies: 163
Views: 157913

Re: Love.js - A Direct Emscripten Port

Found another minor bug: setWrap("repeat", "repeat") doesn't seem to work correctly. If you look at my previous arena.love build - you can see that the texture "bleeds" and doesn't repeat at all. The shiny logo effect is supposed to look like this: https://steamcdn-a.akamaihd.net/steam/apps/1230160/...
by ivan
Sat Sep 19, 2020 7:20 am
Forum: Ports
Topic: Love.js - A Direct Emscripten Port
Replies: 163
Views: 157913

Re: Love.js - A Direct Emscripten Port

I think if you change the dimensions of the "canvas" element via JS on the page, it should call love.resize in-game. I tried adding a function to index.html which resizes the canvas automatically but it didn't quite work: window.addEventListener("resize", function(e) { var canvas = document.getElem...