How to import single tileset image into xCode (Sprite Kit)? - ios

Example of tileset:
http://www.rpg-studio.org/wiki/images/9/92/Tileset.png
How to import these images into this grid in Xcode?
https://koenig-media.raywenderlich.com/uploads/2016/06/AdjacencyTileGrid.png
The problem is Xcode doesn't understand that there is a lot of subimages inside parent image.
I've already saw a lot of examples which use tiled map editor but it has its own format and you can't design such levels in Xcode's visual editor. So they are not appropriate for me.
I also saw that people always avoid to use tilesets - they somewhere get a lot of separate images instead and doesn't describe what to do with a single big tileset.

The simplest solution might be to just start with individual images that can feed into Xcode’s image handling pipeline.
My understanding of the Tilesets you’ve described is they are produced from individual images with a tool like TexturePacker which is then consumed by the Tiled Map Editor. The tmx maps produced by the Tiled Map Editor are consumed in Xcode using SKTiled for Swift or JSTileMap for Objective-C.

Related

Software to open titled geo PNG file?

I'm trying to extract some a data (a map image) from a PNG file which is tiled somehow. The file itself is only 256x256 pixels (according to 'get info' on the mac) but is is 23MB. It is from an iPad app called Mud Map and it contains a map that I purchased but I've lost the original that I converted to this format. When I view this file (renamed to a .PNG) I see one section of the map - 256x256px.
I'm asking this question on StackOverflow because I want to know more about these tiled images. How does one create a tiled PNG and what is the software that will open and or create these things. I'm interested in what metadata is required too. I'm loving the outdoors and mapping!!
The answer to this question, is that it cannot be done in manner I have described.
The images in the PNG are not tiled, the the files are just merged together which is no doubt an individual feature of the program as is it does not appear to be any kind of standard.
I have no access to application you mentioned in IPad. Just share some thought about possible situation here.
1) Map tiles are commonly used in GIS web application such as Google maps and so on. It is used to improve the performance especially when user pan very often. A map displayed typical map window is divided into for instance 4*4 separate calls. So maybe only 4 call will be made when user just pan a little bit instead of get the whole map for the 16 tiles.
The source image for this tiles can be in pre-generated tiles or just one static map.
2) Assemble separate images to one in GIS is called image mosaic function. GIS server can read a collection of images and mosaiced them into one with the overlapping part handle based on a certain rule. And the images are in pre defined grid format which are seamless and no overlapping, then it is called tiled images. We could pre-generated the tiles from one mosaiced image, or we can server it on the fly. Some GIS server/library/application does have the tile server function built in.

SpriteKit Map Creation Through Image Pixels

I recently downloaded a project made by apple with SpriteKit to have a look at their code and I noticed something that looked quite interesting. They created their entire map using an image
(project link below- image found at AdventureShared/Assets/Environment/map_level.png)
by taking it apart pixel by pixel. I can't seem the find the code by which they do this in the project but would like some idea on how to do something similar. If anyone could either show me where i can find the code in the project or advise me on how i could replicate the procedure, it would be greatly appreciated. I will give a link to the project below as i am not sure if i can show the code as it is pre-release for iOS8. Thanks a lot!
https://developer.apple.com/library/prerelease/ios/samplecode/Adventure-Swift/Listings/Adventure_Adventure_Shared_AI_ChaseAI_swift.html#//apple_ref/doc/uid/TP40014639-Adventure_Adventure_Shared_AI_ChaseAI_swift-DontLinkElementID_4
Take a look at code:Explained Adventure in there the developers break down exactly how the world generation works, including the pixel mapping and why they chose that method.
Some additional info on how it can be done:
This picture is merely to guide the game designer in the construction of the .sks file
https://developer.apple.com/library/mac/documentation/GraphicsAnimation/Conceptual/CodeExplainedAdventure/Art/map_collision_2x.png
However these images below are texture atlases made by dividing an image of size 4096 by 4096 into 32 tiles by 32,(approximately a 1000 tiles in total).
https://developer.apple.com/library/mac/documentation/GraphicsAnimation/Conceptual/CodeExplainedAdventure/Art/background_texture_atlas_2x.png
To generate these tiles I used gimp. I downloaded a script called to grid to guides and then after using that new tool to make a grid across the image, I went to Filters>Web>Slice and generated all the Tiles. Swift automatically takes the individual tiles and configures them into a texture atlas if they are contained in a file called name.atlas

How-to get "redundant tiles" into MBTiles's sqlight tile view?

At MBTiles Link there is a section:
Using views to reference redundant images
MBTiles can reduce the amount of space used by these redundant tiles drastically by implementing the tiles table as a view
If I have z/x/y folder of png tiles how to i get the "mbutil" to import identical png images
into the tiles view? Or would I have to do it by myself after "mbutil" has done its import into sqlite? if yes are there any scripts available for this?
Currently mbutil does not support compression like TileMill does - the code is there, but not connected to the executable you get when you install it. An enterprising Python developer could do the wiring to make it possible; otherwise, TileMill is the main application that outputs compressed MBTiles.

image processing library for colour identification

I am going to use Unity 3D to create a Flood Management game.In the game,I will project a terrain created in Unity and the user will place objects like dams,levees etc.All these objects need to be recognized via a camera using some image processing technique.Any ideas as to how I should go about this?We thought of placing QR codes on these objects, but that wont work as we will have to recognize multiple QR codes from one image which is probably not feasible.Also, are there any other efficient methods
Wow lots of nice ways to do this.
Easiest: Color tracking using colors
Harder but more interesting: Use Vuforia plugin with markers.
Stephane

Drawing a path in Photoshop/Illustrator, using it in iOS

I am looking for a more convenient way of drawing a path than by drawing it programmatically. Is there any way of drawing a path in Photoshop (or Illustrator) and getting that path to the iPhone to use in a CAKeyframeAnimation? e.g. by exporting the point data, or by importing the .ai file?
There's a GitHub project called "PocketSVG" that can create UIBezier objects from SVG files. It works perfectly with shapes created in Adobe Illustrator and exported to SVG Tiny 1.2.
I ended up using Opacity. Opacity is a nifty little program that will allow you to draw paths (or import images) and export source code for iOS (e.g. Quartz).

Resources