Color me help

This topic contains 11 replies, has 3 voices, and was last updated by  Scott 3 months, 4 weeks ago.

  • June 6, 2016 at 11:27 am #151154

    Hi, I wanted to ask in the “color me sks” I would like to be able to paint over each color painted by the user.

    The problem I am facing is that certain colors sit over the other, and I cannot see a way round this?

    Also is it possible for a eraser? (I could just use white if it is possible to over lap colors).

    Thanks very much

  • June 6, 2016 at 11:31 am #151155

    Hmm. I’ve noticed recently Sprite Kit isn’t always respecting that the most recently added node is by default on top of less recent ones. So let me see if thats the case, and if so, I can fix it real fast. For erasing, I’d say just go with white for now.

    • June 6, 2016 at 11:34 am #151156

      Thanks for fast reply, this has been confusing me for a while and would love to make a app using this, so if it is possible to always have the color selected be able to paint over the color just painted. that be so awesome.

      I await to hear..

      Thanks 🙂

  • June 6, 2016 at 12:02 pm #151157

    Okay, if you feel pretty comfortable inserting a bit of code, that might be easier than redownloading the kit…

     if (  pageSettingsDict?.objectForKey("IgnoreSiblingOrder") != nil ){
                
                if pageSettingsDict?.objectForKey("IgnoreSiblingOrder") is Bool {
                    
                    self.view!.ignoresSiblingOrder = pageSettingsDict?.objectForKey("IgnoreSiblingOrder") as! Bool
                    
                    
                } else if let theString =  pageSettingsDict?.objectForKey("IgnoreSiblingOrder") as? String  {
                    
                    self.view!.ignoresSiblingOrder = testTruthOfString(theString)
                    
                    
                }
                
                
            }

    You want to put that if statement anywhere inside of the func parsePageDictionary() in Page.swift file. Right after the function line is fine.

    Then in your property list for the page, find the Settings dictionary, and set
    IgnoreSiblingOrder to NO

    Turns out there’s some optimization that occurs if ignoring sibling order is set to true but then you get those cases where the z depth of the most recently added node is willy nilly.

    I tested a few times in the Xcode Simulator and it seems to work. Keep me posted!

    • June 6, 2016 at 11:34 pm #151195

      That has worked a treat, thanks!

      Is it possible to have 2 Brush sizes “Drawing ward”.

      Thanks

    • June 7, 2016 at 3:18 am #151197

      I have been trying to create 2 drawings wands so that you can do some detail but also have a bigger drawing wand. Sadly I can not work out how to have different sizes?

      I break the build every time i do this and if you can help that be great.

      Thanks so much

    • June 7, 2016 at 1:08 pm #151260

      No problem. Got this working for ya. It’s a good lesson to in making use of Actions.

      Step 1.

      Make two new action dictionaries. You can use the existing Actions dict in the Root of the property list. Since scaling up or down is pretty common, you might want to use these same Actions on multiple pages, so the Root Actions dictionary is the best place for them….
      Coloring App in Xcode

      Step 2.

      Next add two new Elements to the scene. Call them ScaleUpBrush and ScaleDownBrush.
      Coloring App with Xcode

      Step 3.

      Add the ScaleUpBrush and ScaleDownBrush dictionaries to your Elements dict for the page. Then add the properties you see below…

      Coloring App with Xcode

      Nice thing is you can adjust how much the DrawElement is scaled up or down using those actions. Right now they are set to 2.0 (double) and 0.5 (half). So tweak up or down as preferred.

    • June 7, 2016 at 1:55 pm #151261

      That is a awesome reply! thanks again with all the help – works prefect!

      Will drop you a email when its released so you can see the app!

    • June 7, 2016 at 1:58 pm #151262

      Please do! Can’t wait to see it =)

  • August 5, 2016 at 3:37 pm #154035

    Hi Adam,

    I was hoping I could pick your brain on the colouring page. I am finding that after colouring for a few minutes or less the page has a real problem outputting the DrawnItem. I am on an iPad Pro, so power isn’t the issue, but I was wondering if you have experienced anything like this and if so, how did you go about correcting the issue. Thank you in advance for any insights you can provide

  • August 5, 2016 at 4:26 pm #154036

    Well keep in mind the coloring page is really just generating new sprites to color / stamp however you want to think of it. Its not exactly a paint app but “serviceable” for simple kid apps. My approach in coding it was just to make the same thing I’ve seen in my kid’s apps, which satisfies them, but again, if you’re an adult trying to color in the lines and really make something nice, ehhhh.

    One thing you could do is increase the size of the sprite being drawn and you could also decrease how often it is added to the scene. That last part would just take a little tinkering with the code and increasing the delay between drawing a new node.

  • August 5, 2016 at 9:41 pm #154049

    Hi Justin,

    Thanks as always for the insight. I think as usual I am overthink things and moving trying to do more than what is needed. When you say increase the size of the sprite, do you mean the using the transform handles to make the drawn item element bigger?

    I think decreasing how often the sprite is added to the scene might be helpful, because the colouring comes in really fast and nice to begin with and then is slowing to a crawl. I rather everything be consistently slower so it doesn’t feel like the app is choking up.

    Could you explain in a little more detail how to accomplish this, or is it just done the the Plist

    Thanks for your help!

You must be logged in to reply to this topic.