Hello Guest

Author Topic: Adjustable Trimming, suggestion or help to get tk2d code modified  (Read 3996 times)

drkucho

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 72
  • Retro Arcade Freak
    • View Profile
    • Dr. Kucho!
Hello

im using small sprites with bilinear filter so the sprite, once its zoomed in a 4x zoom camera all pixels of the sprite get a very nice blur fx that it is a must in my game in order to get an old tv effect

the only problem is that i have to disable trimming in order to get this blur to work right, otherwise the pixels of the borders of the sprite won't get this blur fx, i guess this sharp border happens because the texture finishes there and have no extra space to blur out, so what i do is to create sprites in photoshop with 1 extra transparent pixel line on the top, bottom , left and right and disable trimming in tk2d sprite collection.

that works, nevertheless... it's long to explain but this issue its slowing down a lot my sprite creation process, i would go 10x faster if i could create sprite sheets with a big grid size and and plenty extra transparent area around them and then let tk2d sprite sheet importer to trim the unused area away BUT leaving 1 extra pixel margin so the bilinear filter can blur the borders properly.

im looking in the tk2d code to see if i find the trimming function ... but no luck so far

thanks in advance !

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Adjustable Trimming, suggestion or help to get tk2d code modified
« Reply #1 on: December 07, 2014, 12:00:44 pm »
Similar request -
http://2dtoolkit.com/forum/index.php/topic,3275.0.html

This is a two parter, first you'll need to add a pixel to the texture. tk2dSpriteColectionBuilder.ProcessTexture calculates the non clear bounds, to which you can add one pixel in all sides. You might also

Second part is as described in that post there, additional padding geometry will need to be added to the geometry.

drkucho

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 72
  • Retro Arcade Freak
    • View Profile
    • Dr. Kucho!
Re: Adjustable Trimming, suggestion or help to get tk2d code modified
« Reply #2 on: December 09, 2014, 03:33:38 pm »
thanks i just subscribed to that thread