Love2D Floating Text - Simple floating text system

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
Hipreme
Prole
Posts: 15
Joined: Wed Jun 03, 2020 9:57 pm
Contact:

Love2D Floating Text - Simple floating text system

Post by Hipreme » Wed Jun 03, 2020 10:03 pm

It lets you do floating text, commonly used for displaying combat text in JRPGs

Simple example:

Code: Select all

PopupTextManagerInstance:addPopup(
    {
        text = "Example Text",
        font = yourFontInstance
        color = {r = 255, g = 0, b = 0, a = 255},
        x = 200,
        y = 200,
        scaleX = 4,
        scaleY = 4,
        fadeIn = {start = 0.2, finish = 0.7},
        fadeOut = {start = 0.7, finish = 2},
        dX = 40,
        dY = 40,
        duration = 2
    })
Features
Features
- Input a Class base for PopupTextManager
- Use your own render function
- Move by parameters
- Circular Motion
- Fade In and Fade Out
- Blend Modes, Scaling, Rotation, Time on Screen
- Add your own font to the text

Add the PopupTextManager instance to the love.update a love.draw function, the it will take care of everything

Download it on: https://github.com/MrcSnm/Love2D-Floating-Text
Attachments
floating-text.gif
floating-text.gif (133.82 KiB) Viewed 7298 times

hasan
Prole
Posts: 4
Joined: Sun Jan 29, 2017 12:09 pm

Re: Love2D Floating Text - Simple floating text system

Post by hasan » Thu Jun 04, 2020 4:52 pm

it shows an error while trying it:

Code: Select all

Error

lib/effects/PopupTextManager.lua:139: Invalid blend mode 'additive', expected one of: 'alpha', 'add', 'subtract', 'multiply', 'lighten', 'darken', 'screen', 'replace', 'none'


Traceback

[C]: in function 'setBlendMode'
lib/effects/PopupTextManager.lua:139: in function 'render'
main.lua:92: in function 'draw'
[C]: in function 'xpcall'


User avatar
zorg
Party member
Posts: 3043
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Love2D Floating Text - Simple floating text system

Post by zorg » Thu Jun 04, 2020 5:53 pm

Was probably made for a different löve version.
Me and my stuff :3True 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.

Hipreme
Prole
Posts: 15
Joined: Wed Jun 03, 2020 9:57 pm
Contact:

Re: Love2D Floating Text - Simple floating text system

Post by Hipreme » Fri Jun 05, 2020 3:08 am

hasan wrote:
Thu Jun 04, 2020 4:52 pm
it shows an error while trying it:

Code: Select all

Error

lib/effects/PopupTextManager.lua:139: Invalid blend mode 'additive', expected one of: 'alpha', 'add', 'subtract', 'multiply', 'lighten', 'darken', 'screen', 'replace', 'none'


Traceback

[C]: in function 'setBlendMode'
lib/effects/PopupTextManager.lua:139: in function 'render'
main.lua:92: in function 'draw'
[C]: in function 'xpcall'

I'm sorry, I've updated on the same day the code in the manager, but forgot about main, it needed simply to change from 'additive' to 'add', it is already updated on github

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests