Posts

Post not yet marked as solved
1 Replies
1.1k Views
Ok here is my situation:Normal grid Tilemap with tiles 32x32 size. For terrain this is no brainer I have created tilesets and everything, but problem comes to when I want to place objects that are bigger than 32x32 on tile map. Like one object being 96x102. I could create tileset with tiles width 96, but then player couldn't place object anywhere depending on 32x32 grid, but only on tiles divisible by 3. I can't find any tutorial or example for that on internet and I have no idea how to tackle that problem. Should I keep bigger objects in some array and render them manually? I would really like to use tilemap as it makes much easier to make camera scrolling (no need to calculate positions of every object) and much easier for computations (less nodes on screen). Another question would be, if ti is possible to "attach" code class in tileset editor to specific tiles (would be SKNode or SKSPriteNode extended class. I would need some processing and custom logic on this "objects" placed on tilemap.
Posted
by matejp.
Last updated
.
Post not yet marked as solved
0 Replies
2.8k Views
Whenever I use scaling on SKTileMapNode and then call tileColumnIndex and tileRowIndex I get wrong numbers.How does this detection of tiles work when scaling the map?I need to scale map to fit playing board onto mobile screen.Currently having big issues with that so if there is any advice about getting content to properly fit to mobile screens as well tablets and desktop I would be happy. I have already completed logic of my game, game is playable and everything, now I have to fit it for mobile devices and also test it. After that only graphical revamp and it will be ready for app store (I hope).For now I have detection made like this:override func mouseMoved(with event: NSEvent) { var position = event.locationInWindow let col = tilemap.tileColumnIndex(fromPosition: position) let row = tilemap.tileRowIndex(fromPosition: position) print("x: \(col) , y: \(row)") //...some more code... }When scaling col and row are totally off as they should be. (also using pointy hexagonal map if that is any needed info?)
Posted
by matejp.
Last updated
.