Vote count:
0
Needing to implement a search feature inside a SpriteKit SKScene to traverse through my SKScene's NodeTree.
It may sound like a strange task, but I am confident that it's doable and something that will add unique value to users. I am hoping someone else out there has given it a shot and is willing to disclose their methods to success. (if not, I will share my solution upon completion)
Where I am now:
- Accessing
SKTextureAtlas - Adding the
SKTexture *searchNodeto the scene withsearchNode.name = @"search" - Creating a
UITextFieldthen settingtextField.centerto the node's position in scene. - Setting
textField.boarderStyle = UITextFieldBoarderStyleNone; - Applying a
UITextFieldDelegateto the scene - Creating private
BOOL searching - In
initWithSize:settingself.search = NO; - Using SKScene's
touchesBegan: withEvent: if ([[self nodeAtPoint:point].name isEqualToString:@"search"]) self.searching = YES;Upon user tap- Inside
update if(_searching) {UITextField *searchText = [self startSearch]*startSearch returnstextField[self.view addSubview:searchText]; }ends the if statement.
What I need (toDo still):
- Keyboard Results dynamically responding to NodeTree based on user input
- Displaying child node matches on screen
interested in: Anything else that may make the search functionality creative and useful.
Sorry for the awful code presentation. I made it a step by step list because it's still pretty mangled and needs refactoring.
Thanks!
asked 31 secs ago
Search Bar inside SpriteKit Application
Aucun commentaire:
Enregistrer un commentaire