Draw-it: My next very accurate and efficient line drawing function for GameSalad.

Hi all,

This is my next line draw function for GameSalad. It's much faster, more accurate, and easier to implement than my last.

Please post here for any questions. Thanks!

Draw-it

Draw-it v1.0

Comments

  • VolontaArtsVolontaArts Member Posts: 510
    nice
  • SocksSocks London, UK.Member Posts: 12,822
    Excellent stuff !! :)>-
  • Braydon_SFXBraydon_SFX Member, Sous Chef, PRO, Bowlboy Sidekick Posts: 9,271
    Very cool. Thanks for sharing!
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879
    @ericzingeler -- That's really a great idea you have there. Thanks for sharing it with the community!
  • ericzingelerericzingeler Member Posts: 334
    Thanks guys!
  • kinzuakinzua Member Posts: 554
    Nice work bro. Thanks for sharing. Also put it in the thread by Socks 'Spare Code ! Dump It Here !' Thanks.
  • TheGabfatherTheGabfather Member Posts: 633
    Finally got to try this out, and it's great! :)
    I originally wanted to point out how when you draw vigorously it's not able to keep up and curves start becoming jagged edges, but I realise this is an arrogant statement considering you were already generous enough to share this code with the whole community. Much kudos to you and thanks again!
  • ericzingelerericzingeler Member Posts: 334
    Finally got to try this out, and it's great! :)
    I originally wanted to point out how when you draw vigorously it's not able to keep up and curves start becoming jagged edges, but I realise this is an arrogant statement considering you were already generous enough to share this code with the whole community. Much kudos to you and thanks again!
    Yep, the Read Me actor has details about that. Basically, actors take up memory... and the only object we have available in GameSalad to draw is actors. I'd say this function uses the least amount of actors possible, but we still hit a wall pretty quickly.

    Play around with the settings a bit and you can probably squeeze out a little more efficiency.

    Thanks for the compliments everyone!
  • aquamonkeyaquamonkey Member, PRO Posts: 36
    This is awesome! Thanks for sharing this. I noticed when using this as a secondary scene, a line automatically appears drawn, once the scene changes from one scene to the "Draw-It" scene. Is there a work around that you can suggest? The drawn line starts from one point and ends where ever the mouse cursor is upon opening of the scene.
  • aquamonkeyaquamonkey Member, PRO Posts: 36
    Ok I think I found a solution to my question, that seems to work. I'm a GS rookie, so finding a more veteran approach would be cool. So, if for example you have an intro scene with a change scene button to Draw-it, the draw function actor will, without fully understanding @ericzingeler's impressive math skills, triangulate the touch position used from where the button was pressed to changed the scene, thus resulting in a line that is drawn as soon as the scene changes. Here's what I did to get around this.

    1. Create a new scene attribute (boolean) for the Draw-it scene, set it to false.
    2. In the draw function actor, within the Rule marked "draw line" add a third attribute to the conditions where the scene attribute that you created in the first step, is true. This will keep the unwanted line from being drawn, until the scene attribute is changed to true.
    3. Add a new actor for the Draw-it scene, make it the size of the screen, create a rule when touch is pressed, change the scene attribute, from step 1, to true. This will trigger the rule in step 2, to allow you to draw.
  • FallingBoxStudiosFallingBoxStudios Freelance Graphic Designer Member Posts: 822
    I can't open the project :(
  • EggeyGamesEggeyGames Member Posts: 51
    Awesome
  • aasulli1aasulli1 Member Posts: 1
    awesome I just found this post!! i have been working on a drawing board for a while now I have the pen working like paint and i can change the colors of the pen using a color wheel.. However, space is used up super fast:/ Has anyone found a way around this?
  • fmakawafmakawa Member Posts: 565

    Hi @ericzingeler This is great! is it your most up to date version? Just wondering about the "drawing vigorously" issue mentioned by @TheGabfather .

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    @fmakawa I don't think @ericzingeler is still active on the forums. @Armelline has a drawing template over at GSHelper.com if you want to check that out.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • ArmellineArmelline Member, PRO Posts: 5,327

    @tatiang said:
    @fmakawa I don't think @ericzingeler is still active on the forums. @Armelline has a drawing template over at GSHelper.com if you want to check that out.

    @fmakawa PM me and I'll send you the drawing element. I still haven't tidied it up to put on the forums but you shouldn't have to spend $20+ to just get the drawing mechanic.

Sign In or Register to comment.