The TilemapKit Roadmap is yours! All the ideas and discussions
1 vote Vote

TK: be able to create custom nodes for objects on object layers

Currently TK creates shape nodes for each object. It would be useful to have a callback selector or block that runs for every object on every object layer when the map loads.

-(TKNode*) nodeForObject:(TKObject*)object layerNode:(TKObjectLayerNode*)layerNode {
// create custom node for object and customize its properties
TKNode* node = ... ;
node.position = object.position;

// if returned node has no parent, then by default it will be added to layerNode
return node;
}

If callback is not supplied or returns nil, a shape node is created by default.

sitterheim, 24.07.2015, 10:07
Response from the site administrator
sitterheim, 22.08.2015
Done. There's now a delegate object you can assign to TKMapNode. It will call a callback selector for every object that allows you to return a custom node. Return nil to skip creating a node for that object (you can still use the object's data for other means).

See this link:
http://tilemapkit.com/class-reference/html/Protocols/TKMapNodeDelegate.html#//api/name/nodeForObject:objectLayerNode:
Idea status: completed

Comments

Leave a comment