omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    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.


    Help for widget

    Pythonista
    widgets button iphone textfield
    5
    50
    17377
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • stephen
      stephen last edited by

      @crazy666 Encore une chose, si vous utilisez Google Chrome vous pouvez aller à ce lien et utiliser construit dans translater pour lire des documents en français

      1 Reply Last reply Reply Quote 0
      • stephen
        stephen last edited by

        Bonne chance ! nous sommes ici si vous avez des problèmes. mais s'il vous plaît donner que vous êtes nouveau à la fois python et pythonidta toujours vérifier les documents et les postes de recherche avant de poster. dans un premier temps, la plupart des problèmes auront déjà une solution d'un autre problème 🙃 voyages heureux

        1 Reply Last reply Reply Quote 0
        • crazy666
          crazy666 last edited by

          No i want learn english to

          cvp stephen mikael 4 Replies Last reply Reply Quote 1
          • cvp
            cvp @crazy666 last edited by cvp

            @crazy666 Hello, welcome here.

            I'm also French speaking and my English is not good at all but I try to always write here in English, surely with a lot of errors.
            @stephen has been very kind to translate all his advices in French but, personally, I think we should all write in English here. For this reason: if somebody meets the same problem as you, he would never find in this forum the right topics if everybody writes in his/her own language.
            And to understand the topic, each user would need to translate it, instead of only one person, you for instance who could translate his questions and their answers to/from English.
            That's really not an attack, only my opinion.
            For info, it happens that I also need to translate some words from English to French, and I use Google Translate or select/popup menu/definition if you have defined English and French as languages.

            1 Reply Last reply Reply Quote 1
            • cvp
              cvp @crazy666 last edited by

              @crazy666 And I want to add that all your first posts, in English, were very good and understandable.
              Good luck with Python and this marvelous Pythonista app with a forum full of incredible guys/girls.

              1 Reply Last reply Reply Quote 1
              • stephen
                stephen @crazy666 last edited by stephen

                @crazy666 outstanding ill be on for w few hours if u need any further help. @mikael @ccc @JonB @cvp and many more are wonderfull in assisting in different areas pythonista's lib. looking forward to see what all you come up with!

                banner

                1 Reply Last reply Reply Quote 0
                • stephen
                  stephen last edited by

                  @cvp i agree i just like to help however i can 😊

                  cvp 1 Reply Last reply Reply Quote 1
                  • cvp
                    cvp @stephen last edited by

                    @stephen I understand and I also want to help others, if I can.
                    It was not a criticism of your kind help and effort, it was only my personal opinion and I don't want to ask other people to share my opinion, sincerely. I would even be happy to help in French if no other way exists.

                    1 Reply Last reply Reply Quote 0
                    • stephen
                      stephen last edited by

                      @cvp

                      I do agree on just observing english 🙃 and i myself observed Zero negative intention in your coment. just logic and care for community. well im off to try and get this event system structure going.. lol

                      1 Reply Last reply Reply Quote 0
                      • mikael
                        mikael @crazy666 last edited by

                        @crazy666, just for fun, here’s the ”almost standard” way of wrapping a number range from 0 to (how_many-1):

                        i = (i+1) % how_many
                        
                        1 Reply Last reply Reply Quote 1
                        • crazy666
                          crazy666 last edited by

                          Wait i work on 😉

                          1 Reply Last reply Reply Quote 0
                          • crazy666
                            crazy666 last edited by

                            @cvp i understand ,it logic

                            1 Reply Last reply Reply Quote 1
                            • crazy666
                              crazy666 last edited by

                              Hello i have a question ...
                              what is the difference between frame and scene?
                              i'm desperate i don't know how to restart
                              What is the best to start ?
                              Create view class and after add fonction?
                              Or what is the best strategy for write

                              I don't want use ui editor becose i want understand structure

                              Thanks for help me !!

                              cvp stephen 2 Replies Last reply Reply Quote 0
                              • cvp
                                cvp @crazy666 last edited by

                                @crazy666 Hello, I understand that it is not easy to start because the app provides so much functionalities.
                                Do you know the local help of Pythonista by selecting a word?
                                This displays a little popup menu where you can tap help and you will get the local help of the module or method or function....

                                1 Reply Last reply Reply Quote 1
                                • stephen
                                  stephen @crazy666 last edited by stephen

                                  @crazy666 said:

                                  Hello i have a question ...
                                  what is the difference between frame and scene?
                                  i'm desperate i don't know how to restart
                                  What is the best to start ?
                                  Create view class and after add fonction?
                                  Or what is the best strategy for write

                                  I don't want use ui editor becose i want understand structure

                                  Thanks for help me !!

                                  frame

                                  in the instance of ui module is a Rect that we talked about last time and if i understand correctly, does some initial calculation when object is created.

                                  • x
                                  • y
                                  • width
                                  • hieght
                                  • bounds
                                    so on..

                                  scene

                                  This is a complete, actually a chain of, modules for bridging Pythonista with SceneKit from Apple. it has many connections with the ui module. the class Scene that your MyScene class dirives from is itself a sub-class of SceneView from ui. with this said you can alternativle write a ui project and make one View element sub-class SceneView and write a MyScene class then set your MySceneView.scene = MyScene() and this allows you to present your scene in your ui other than forcing fullscreen.

                                  so for this part,

                                  frame is an attribute of ui.View (scene nodes you generally set the Node.position and Node.size. position being a Point object and size a Size object. i belive even if you pass a normal 2tuple scene should convert to object needed but i find its much cleaner and good practice to just explucitly instance the object.
                                  hint: MySprite.position = MyScene.size/2 willconvert the Size object to Point object while setting sprite to center of screen 😉🤓

                                  scene is a module for animations and Game Development. not limited to though.. see here for documentation on scene module.



                                  I personally suggest you learn scene then continue with ui while using SceneView. but its really up to whats comfortable for you buddy..

                                  my typical path i take is similar to following for starting scene projects...
                                  -import my standart modules..

                                  inside a core.py i place all my imports. including my from scene import *.

                                  • wrighy out mt factory functions..

                                    functions that creat my nodes and other objects. this helps maintain consistency and reduce programer error from typos.. ⤹⤹⤹

                                  example...
                                  
                                  	#explicitly i pass Point and Size objects..
                                  	#leave out size for LabelNode to allow autosizeing ⤶
                                  	#to font and string sizes..
                                  	def new_label(text=None, point=None, size=None, 
                                  					parent=None, font=('Helvetica', 16)):
                                  		label = scene.LabelNode(
                                  			text=text,
                                  			font=font,
                                  			position=point, 
                                  			size=size,
                                  			parent=parent,
                                  			anchor_point=(0.5, 0.5)
                                  		)
                                  		
                                  		# ... add logic for creating all labels ...
                                  		return label
                                  		
                                  	
                                  	now inside main script...
                                  	from core import *
                                  	w, h = get_screen_size()
                                  	
                                  	class MyScene(Scene):
                                  		def __setup__(self, *args, **kwargs):
                                  			self.score = 0
                                  			self.score_display = new_label(self.score, 
                                  						Point(w/2, h-50), Size(150, 45), self)
                                  
                                  

                                  *note: im using scene from core.py instead of importing in both.. this allows me to creat scene objects in core.py without doing from scene import ... for everything i use. if both scripts core and main did from scene import * the interpreter will not import core.py. with message cannot import core.

                                  • from here sky is the limit!

                                  i hope this helps you in what you needed

                                  Also..

                                  using UI Builder wont effect your path in learning structure. it only give a visual interactive way to set up the ui. you can still programatically set properties and have a custom view class..

                                  1 Reply Last reply Reply Quote 1
                                  • roku_one
                                    roku_one last edited by

                                    I tried to use the same screen widget for many porpuse. And it work. It just a shame that put a button also depends of the lengh of the text inside

                                    stephen 1 Reply Last reply Reply Quote 0
                                    • crazy666
                                      crazy666 last edited by

                                      @cvp i swipe left and i use "?" For search description

                                      cvp 1 Reply Last reply Reply Quote 0
                                      • cvp
                                        cvp @crazy666 last edited by

                                        @crazy666 that's the right way to access total local help and a search on it

                                        1 Reply Last reply Reply Quote 0
                                        • crazy666
                                          crazy666 last edited by

                                          Thanks you @cvp

                                          cvp 1 Reply Last reply Reply Quote 0
                                          • cvp
                                            cvp @crazy666 last edited by

                                            @crazy666 But don't forget Pythonista offers also the possibility to use the
                                            select / popup menu / help like showed some posts above

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Powered by NodeBB Forums | Contributors