loudoweb / SpriterHaxeEngine

Engine to use Brashmonkey's Spriter SCML for haxe.
MIT License
66 stars 15 forks source link

cannot tileImages with TileLayerLib when targeing Windows, or Android #16

Closed SamuelWeeks closed 8 years ago

SamuelWeeks commented 10 years ago

example--- If you try to put spriter objects side by side like in a tile map on windows or android. you will see a noticeable gap between the images. publishing to htlm5 or flash does not have this problem.

I have tested this with bitmapLib and SimpleBitmapLib. and they work fine. the problems seems to only occur when using the TilelayerLib

loudoweb commented 9 years ago

Hi, do you still have this problem?

loudoweb commented 9 years ago

I had the same issue with my tiles which use width and height of 75. The default pivot on tilelayer is the center of the tile (37.5 here). There are known issue when you put graphics on float positions. We should always prefer integer positions for tiling.

To solve this problem you can use the offset property of the TileSprite (which is relative to the center, so it has to be negative to get back to the top left) or you can use this commit on Tilelayer library (https://github.com/elsassph/openfl-tilelayer/pull/4). I think TilelayerLibrary here need an update :) Two solutions : or we make it global by using my PR or we set the offset everytime (so we create an instance of Point every time... :( )

Then I think we can just delete this override (https://github.com/loudoweb/SpriterHaxeEngine/blob/master/spriter/library/TilelayerLibrary.hx#L85-103)

loudoweb commented 9 years ago

@SamuelWeeks my PR has been accepted on tilelayer, now we have to know what we should do in the spriter.library.TilelayerLibrary