Hey!
Is there a way, in a regular LÖVE game, to create a new "Drawable" object, i.e. one that can be drawn using love.graphics.draw?
If so, how would I go about doing that?
Thanks!
Creating Custom Drawables?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
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.
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.
Re: Creating Custom Drawables?
Mh alright...
Thank you anyway!
Thank you anyway!
Re: Creating Custom Drawables?
Hi, what exactly are you trying to do, visually?
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Creating Custom Drawables?
If you want different shapes, then there are quite a few ways to make those (Polygons, Meshes); you don't need your own Drawable class.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: Creating Custom Drawables?
On an unrelated note, it would be cool if "Body" was "Drawable" for debug purposes.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 2 guests