SKTiled
SKTiled copied to clipboard
SKTile highlight color is defined by frameColor
In testing intergration, I'm testing touch events, highlighting a tile when it's touched.
In my touchBegan
function, I have the following...
let layer = Game.sharedInstance.tileMap?.getLayer(atIndex: 0) as! SKTileLayer
let coord = layer.coordinateAtTouchLocation(touch)
let tile = layer.tileAt(coord: coord )!
tile.highlightColor = SKColor.blue
tile.highlightDuration = 2
tile.showBounds = true
When I touch a tile, I expect it to highlight blue, but it highlights using the default colour, lime. I tried to set the highlight colour for the whole Tilemap...
Game.sharedInstance.tileMap?.highlightColor = SKColor.orange
Still, does not change the colour.
I in stead change the frameColor...
tile.frameColor = SKColor.blue
And this has the desired effect.
highlightColor
doesn't seem to be the colour used for highligting a tile. Am I implementing the "highlight a tile" functionality wrong? This seemed to be how it was done in the documentation and the example project.
Thanks in advance.
Apologies for the late reply, I'm traveling in Asia until the end of March with no laptop. The debugging methods have been long needing some love, so I'll take a look at this when I get back.
No worries! This is an awesoem library, and super useful. I've made some good progress on my intergration. Just handling coordinate conversion now (Read the docs. They are good, so thankyou!).
I'm happy to help test any pre-releases after I've completed my initial intergration, which is likely to be after the end of March anyway.