Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SKTile highlight color is defined by frameColor #26

Open
Relequestual opened this issue Feb 27, 2019 · 2 comments
Open

SKTile highlight color is defined by frameColor #26

Relequestual opened this issue Feb 27, 2019 · 2 comments

Comments

@Relequestual
Copy link

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.

@mfessenden
Copy link
Owner

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.

@Relequestual
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants