Color Me Sample Application – Skscene Canvas Download

Home 3 Forums iOS / tvOS Starter Kits The Story Tellers Kit 2 for iOS or tvOS Apps Color Me Sample Application – Skscene Canvas Download

This topic contains 5 replies, has 2 voices, and was last updated by  CartoonSmart 7 months ago.

  • March 17, 2017 at 5:35 pm #163348

    Hey there,

    In the ColorMe scene that’s included in the samples of Story Teller 2, how would you add a button on the scene to download what the user has drawn in the canvas of the scene?

    Thanks for any help,
    Michael

  • March 19, 2017 at 4:04 pm #163415

    Ok, so I made a sample project and wrote the code for the button to appear and the button action.

    Trying to insert this code on the ColorMe SKS file and can’t figure out where to put it. I did see a section in Element_Extension.swift for custom code, but no luck so far.

    Any help is appreciated,
    THanks!!

            let btn: UIButton = UIButton(frame: CGRect(x: 100, y: 400, width: 100, height: 50))
            btn.backgroundColor = UIColor.white
            btn.setTitle("Click me", for: .normal)
            btn.addTarget(self, action: #selector(buttonAction), for: .touchUpInside)
            btn.tag = 1
            self.view.addSubview(btn)
    
    }
        
        func buttonAction(sender: UIButton!) {
            let btnsendtag: UIButton = sender
            if btnsendtag.tag == 1 {
                print("Button touched!!")
            }
        }
  • March 24, 2017 at 3:01 pm #163764

    You probably don’t want to add a UIButton. That starts getting into mixing in Sprite Kit with the rest of the UIKit world.

    If you’re just trying ot save a screenshot, thats possible already. There’s an event called SaveScreen. No value is needed.

    Details here…
    https://cartoonsmart.com/using-pictures-from-the-camera-roll-story-tellers-ios-starter-kit-documentation/

    Though, as a parent with kids that have coloring apps with save options, its pretty annoying. They fill up their Photo libraries with garbage.

  • March 24, 2017 at 3:06 pm #163765

    Oh awesome, I will check out that link later today and see what I can figure out.

    My coloring app is more for adults, so it’s ok for this use…they can clean out their own gallery if they go nuts! 🙂

    MG

  • March 25, 2017 at 11:23 am #163779

    Well, I copied the save button from the editmask scene to the colorme scene and added DrawingOutline in the string in the plist and nothing.

    I’m sure I’m missing something small…but I’m pulling my hair out 🙂

    Thanks,
    Michael

    • April 17, 2017 at 8:46 am #165380

      Sorry for the delay, didn’t see this. So DrawingOutline was added to where? If you’re still just trying to save the screen you don’t need to specify what is being saved.

You must be logged in to reply to this topic.

Download the new CartoonSmart TV App - Organize all your FREE and Premium Lessons

Get it!