[Solved] Haxe with Love

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Paltze
Prole
Posts: 10
Joined: Mon Aug 09, 2021 9:33 am

[Solved] Haxe with Love

Post by Paltze »

I am interested in using Haxe with Love. After searching it I found this:
https://github.com/bartbes/love-haxe-wrappergen
But neither its README nor anywhere else on the web elaborates on how to use it. Please elaborate on how to use it. Thank you in advanced!
Last edited by Paltze on Tue Aug 17, 2021 5:55 am, edited 2 times in total.
User avatar
GVovkiv
Party member
Posts: 685
Joined: Fri Jan 15, 2021 7:29 am

Re: Haxe with Love

Post by GVovkiv »

TLDR: or just check https://github.com/robertoEpe/love-haxe-wrappergen, this fork looks better done and have examples, you may check it instead

1 download https://github.com/love2d-community/lov ... f8625c671c (love_api.lua, and modules folder)
2 download https://github.com/bartbes/love-haxe-wr ... haxify.lua
3 put all that somewhere where you want to use it with main.lua
4 in main.lua put

Code: Select all

require ("haxify")
5 in haxify.lua,

Code: Select all

api = require "love-api.love_api"
probably should be changed to

Code: Select all

api = require "love-api"
6 run main lua
and done?
Paltze
Prole
Posts: 10
Joined: Mon Aug 09, 2021 9:33 am

Re: Haxe with Love

Post by Paltze »

Thank you. I tried both methods. The fork worked for me. Leaving the steps if someone else needs help (Love2d installation required):
1. Clone repo or download code for https://github.com/robertoEpe/love-haxe-wrappergen
2. In love-api folder download https://github.com/love2d-community/love-api/
3. Create a main.lua file in root folder and write

Code: Select all

require("haxify")
4. Run main.lua as Love game
5. Done! Externs are generated in a folder named "love".
6. To use with haxe copy the folder in project and just put the following at top of every file:

Code: Select all

import love.LOVE;
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 2 guests