04-04-2019, 09:03 PM
(This post was last modified: 04-04-2019, 09:10 PM by JaumeAlcazo.)
Oops, sorry for the delay, I did not get notified by mail of the response in the thread
I think the mail sending is very delayed, as we talked some time ago.
Thanks for your comments
About the text, I did some unsuccessful experiments with Cairo (https://www.cairographics.org/) before settling with SDL_ttf (https://www.libsdl.org/projects/SDL_ttf/).
Now, when a text is asked to be drawn (yes, in realtime) I draw it with SDL_ttf to a SDL_Surface, then I save the surface it to a .png with IMG_SavePNG (I think this is in SDL image), then write a .txt on the fly with the correct width and then read back from Tilengine with TLN_SetLoadPath, TLN_LoadSpriteset, TLN_ConfigSprite and TLN_SetSpritePosition. So, many things happen each time the player hovers over a item or object and the text is drawn in-screen.
I thought it might be too much to do in realtime, but it turns out that is very fast and with no noticeable delay
Another point of interest are the ghosts. I tried to make them appear with the 25%, 50%, 75%, 100% opacity but the effect was not cool enough for this particular case (by the way I used this type of opacity with the text that pops up when you click something that makes you gain experience and lose sanity).
So I ended up doing the transparence I think with increments of 10% and combining the layers in Photoshop to a new flat image to be used in the animation. Of course this has the disadvantage that it must be done on every type of possible wall in your wallsets, for instance, when we go down in the dungeons I will do it again to make appear a different type of ghost (a big creepy mouth) there in the dungeons.

Thanks for your comments

About the text, I did some unsuccessful experiments with Cairo (https://www.cairographics.org/) before settling with SDL_ttf (https://www.libsdl.org/projects/SDL_ttf/).
Now, when a text is asked to be drawn (yes, in realtime) I draw it with SDL_ttf to a SDL_Surface, then I save the surface it to a .png with IMG_SavePNG (I think this is in SDL image), then write a .txt on the fly with the correct width and then read back from Tilengine with TLN_SetLoadPath, TLN_LoadSpriteset, TLN_ConfigSprite and TLN_SetSpritePosition. So, many things happen each time the player hovers over a item or object and the text is drawn in-screen.
I thought it might be too much to do in realtime, but it turns out that is very fast and with no noticeable delay

Another point of interest are the ghosts. I tried to make them appear with the 25%, 50%, 75%, 100% opacity but the effect was not cool enough for this particular case (by the way I used this type of opacity with the text that pops up when you click something that makes you gain experience and lose sanity).
So I ended up doing the transparence I think with increments of 10% and combining the layers in Photoshop to a new flat image to be used in the animation. Of course this has the disadvantage that it must be done on every type of possible wall in your wallsets, for instance, when we go down in the dungeons I will do it again to make appear a different type of ghost (a big creepy mouth) there in the dungeons.