Page 1 of 1

Love2D Floating Text - Simple floating text system

Posted: Wed Jun 03, 2020 10:03 pm
by Hipreme
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

Re: Love2D Floating Text - Simple floating text system

Posted: Thu Jun 04, 2020 4:52 pm
by hasan
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'


Re: Love2D Floating Text - Simple floating text system

Posted: Thu Jun 04, 2020 5:53 pm
by zorg
Was probably made for a different löve version.

Re: Love2D Floating Text - Simple floating text system

Posted: Fri Jun 05, 2020 3:08 am
by Hipreme
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