Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
TexturePack.new : how to set filtering to "true" ? — Gideros Forum

TexturePack.new : how to set filtering to "true" ?

Hi

I want to set do the same as Texture.new("image.png", true) - set filtering parameter,
but going the TexturePack/TexturePack:getTextureRegion path.

Taken from the documentation :
-- CASE 1
local texture = Texture.new("image.png", true)
local bitmap1 = Bitmap.new(texture)
stage:addChild(bitmap1)
 
-- CASE 2
local texturePack = TexturePack.new("myTexturePack.txt", "myTexturePack.txt.png")
local region = texturePack:getTextureRegion(...)
local bitmap2 = Bitmap.new(region)
stage:addChild(bitmap2)
My question is : in the Second case, how and where can I set the filtering to true?
I was assuming that the filtering parameter would be available :
  • in TexturePack.new()
  • or in TextureRegion.new()
@ar2rsawseen any idea?

thanks

Likes: Daimyo21

twitter@TheWindApps Artful applications : The Wind Forest. #art #japan #apps
+1 -1 (+1 / -0 )Share on Facebook

Comments

  • NascodeNascode Guru
    Accepted Answer
    Hi @Mells

    just add true for last argument
    local texturePack = TexturePack.new("myTexturePack.txt", "myTexturePack.txt.png", true)
    have fun with our games~
    http://www.nightspade.com
  • @Nascode
    thanks for the quick help!
    Well I would need confirmation (it looks undocumented) because it doesn't seem to work on my end, the parameter doesn't change anything?
    With a confirmation I could know if the problem comes from the resolution of my images themselves (which I thought was unlikely) or somewhere else.
    twitter@TheWindApps Artful applications : The Wind Forest. #art #japan #apps
  • NascodeNascode Guru
    edited September 2013 Accepted Answer
    @Mells

    This is a snippet of my code in production:
    local localSheet = TexturePack.new("sheet.txt","sheet.png" , true, {format = Texture.RGBA4444})
    Basically we could add second and third argument of Texture.new as third and fourth argument on TexturePack.new

    If you are working on Gideros Player, try to set zoom to 100% to see filter effect. I just test it again and filter works as expected (if false it will jagged)
    have fun with our games~
    http://www.nightspade.com
  • ar2rsawseenar2rsawseen Maintainer
    Accepted Answer
    What @Nascode says is true

    @Mells if you look at documentation's constructor of TexturePack:
    http://docs.giderosmobile.com/reference/gideros/TexturePack/new#TexturePack.new
    You will see filtering as one of the parameters, filtering is exactly what you want ;)
  • MellsMells Guru
    edited September 2013
    @Nascode @ar2rsawseen
    Thank you!
    No idea where my head is these days. I *was* looking at the docs and didn't see it.
    Too much coding for a non-coder at 1am and this is what you get ;)

    The result is not nice though, the problem must be coming from something else.
    Another day.
    twitter@TheWindApps Artful applications : The Wind Forest. #art #japan #apps
Sign In or Register to comment.