-
Notifications
You must be signed in to change notification settings - Fork 34
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
Can't change tileAt(x,y) #16
Comments
What you'll need to do is query a tile from its parent layer and set a new texture: if let tile = tileLayer.tileAt(1, 12) {
// create a new texture
let newTexture = SKTexture(imageNamed: "myTexture")
// set texture filtering
newTexture.filteringMode = .nearest
// update texture & size
tile.texture = newTexture
tile.size = newTexture.size()
} Hope that helps, please let me know if you have any more questions. |
Perfect!!! Thank you so much!! Your framework is wonderful!! |
Alright, now I have a new problem. When I change the texture with this commands, sometimes the new texture seems "behind" the tile above. Example: if I change tile(2,2), sometimes its texture's zPos is lower then tile(1,1), and textures like buildings will apear behind texture of tile (1,1). How can I fix this? |
Hi, I'm trying to change a image of a tile, but it does not change.
I don't know if I'm doing the right way.
Can someone please help me?
The text was updated successfully, but these errors were encountered: