On Tue, Oct 28, 2014 at 5:50 PM, Daniel Gillet <[email protected]>
wrote:

> Hello,
>
> I noticed in tiles.py, line 1789 that we call pyglet.image.
> SolidColorImagePattern(color) with color being a list.
> But in pyglet, it seems that SolidColorImagePattern requires a tuple.
>
> If we are under Python 2, we come in the function
> def color_as_bytes(color): if sys.version.startswith('2'): return
> '%c%c%c%c' % color else: if len(color) != 4: raise TypeError("color is
> expected to have 4 components") return bytes(color)
> and '%c%c%c%c' % [128]*4 would produce en exception.
>

Good catch.


>
> I guess the easy fix would be in tiles.py to have on line 1788
> color = tuple(self.color[:3] + [128])
>
>
Thats reasonable.

Would you like to do a PR ?
Its is just a matter to modify the line, create the PR with title as
"fixing tmx color problem in py2.X" and copy your mail as body.

I can do similar if you have no time.


> Regards,
> Dan.
> --
>

thanks,
claudio

-- 
You received this message because you are subscribed to the Google Groups 
"cocos2d discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cocos-discuss.
For more options, visit https://groups.google.com/d/optout.
  • Small bug? Daniel Gillet
    • Re: Small bug? claudio canepa

Reply via email to