Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Add emoji behind text
-
@sodoku I've copied your script in my Pythonista and created a pawn.pyui with a button and a TextField.
This is presented when I tap pause but I really don't understand your request.
Where do you want to store/show the text you type in the TextField? -
The pyui is called pawz not pawn
-
So when you type Game Over or Level 1 in the text field in either scenes pawz menu it adds the emojis to scene A and scene B simultaneously
-
@sodoku yes, pawz, autocorrect 😢
But where this text has to be added?
-
I don’t understand your question I just wanted to add the emoji behind the label node text by typing the label node text into the text field
It works as is but I need to tap page1 then tap the pawz menu type the label node text to add the emojis then I have to tap main to go back to the first scene and then tap page2 then tap pawz then type the label node text again in order to get both pages (scenes a and b) to display the emojis
I just would like to only have to tap pawz once and type the label node text once so the emojis get added to both pages (scene a and b) -
@sodoku ok, I think I understand, please wait a little bit
-
@sodoku sorry for the delay, busy...
This works but very dirty, a little bit obliged by the way you define two scenes without passing by an unic class.touch_began of class MainMenuScene (Scene)
After presentation of a page, init texts of cards with texts of other page...
def touch_began(self, touch): if self.page1.frame.contains_point(touch.location): self.present_modal_scene(a_scene) for child1 in a_scene.children: if len(child1.children) > 0: if 'LabelNode' in str(type(child1.children[0])): lvl = child1.children[0].text for child2 in b_scene.children: if len(child2.children) > 0: if 'LabelNode' in str(type(child2.children[0])): if child2.children[0].text == lvl: child1.text = child2.text elif self.page2.frame.contains_point(touch.location): self.present_modal_scene(b_scene) for child1 in b_scene.children: if len(child1.children) > 0: if 'LabelNode' in str(type(child1.children[0])): lvl = child1.children[0].text for child2 in a_scene.children: if len(child2.children) > 0: if 'LabelNode' in str(type(child2.children[0])): if child2.children[0].text == lvl: child1.text = child2.text
-
I think that solves my question thank you @cvp that will be the finishing touch to my first prototype app I’m developing I just need to buy a iPhone so I can add text recognition to my sudoku app
-
@sodoku good luck with your project
-
if 'LabelNode' in str(type(child2.children[0]))
-->
if isinstance(child2.children[0], LabelNode)
?? -
@ccc I knew it, you have already adviced me, but I had forgotten 😢
-
-
Stick with @cvp code that works.
-
I don’t know if my next question I got for you can be solved, okay so I have added @cvp’s code to mine and it works perfectly, except for the undo and redo functions have now become a little glitchy (not working perfectly), I was wondering if it’s possible to fix this or not??
-
i have no idea whats going on here 😂 but since we are dealing with two separate instances of scene could giving time by
Action.wait(0.5)
(some arbitrary value) or eventime.sleep(0.5)
to inssure processes have time to sync? to help the new found "glitching"?just a guess im only recently getting into threads and processes..
-
The only work around I can think of is limiting only page 1 to have the add emoji input, and undo, and redo while removing those three actions from page 2 to kinda make it idiot/fool proof so the functions undo and redo doesn’t glitch, and users won’t get confused and ruin the order of operations
So basically add emoji, undo and redo would only be available on page 1 and then page 2 would just be a viewable screen to observe then you would have to go back to page 1 to add, undo or redoExcept that would kinda hinder the game play by adding to much unnecessary steps to manually back track, and it would ruin the experience and point of being an app that saves time
I hope this could be fixed that would make this app seem more professional
-
@sodoku if we are dealing with paging.. why not get rid of buttons, and use gestures? should fix current issue and increase time saved for user?
-
The thing is i understand the problem I’m encountering, and the main objective and goal I want to achieve, I just have no clue how to code the solution or if it’s even possible to code a solution, at this level of of coding it’s to easy to make a mistake and not code the proper order of operations
I just know how to ask the smarter people the question, is it possible to fix this problem
-
i know you guys are already this far and i hate to ask people to repeat themselves but im really interested in this situation. if you dont mind can you elaborate on the program and issue?
-