Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Morgana retro Dungeon Crawler (uses Tilengine)
#6
Thanks for your explanations! I don't know why, but this forum platform delays email notifications for days -or even weeks-. I guess it's a combination of my ISP and the forum system...

I know the SDL ecosystem, I use it a lot in my work, good choice. Your approach about text is correct, maybe a bit long trip, but it works. There's a function to modify the pixels of an existing spriteset in realtime, without need to load a new one, but that function requires that the region inside the spriteset atlas is always the same, and that's not your case. Classic systems were limited to fixed-size sprites composed of tiles, and that restriction made easy to modify them. But the use of arbitrary-sized sprites inside a sprite atlas isn't very well suited to do modifications in realtime, although not impossible as you demonstrated.

Regarding transparency, I noticed how the text appears in discrete jumps, corresponding to defferent BLEND_MIXnn blending modes, and it looks cool! Smooth fading can be achieved with addition/multiply blending modes combined with a palette transition. This is how the SNES did those effects. As a personal opinion, I think that smooth blending doesn't fit well with pixel art graphics. Pixel art is about carefully selected and matched colors. Blending destroys this equilibrium, introducing intermediate colors that don't match the original palette.

If you still want to do fading, try this: create a palette that is pure black, clone the palette of the sprite you want to fade, and set blending BLEND_ADD mode with TLN_SetSpriteBlendMode(). For each frame of the fading, call TLN_MixPalettes() passing the black palette and the original sprite palette as sources, and the cloned palette as destination, with a factor going from 0 to 255. Assign the cloned palette to the sprite. When the fade effect ends and reachs factor 255, disable blending, assign the original palette again and delete the cloned palette.
Reply


Messages In This Thread
RE: First video of Morgana game (uses Tilengine) - by megamarc - 04-05-2019, 09:51 PM
WOW!!! - by PerspexSphinx - 11-19-2019, 07:39 AM
Morgana game (uses Tilengine) - by JaumeAlcazo - 01-02-2020, 04:23 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)