GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

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 Posts: 510Member
    nice
  • SocksSocks London, UK.Posts: 12,822Member
    Excellent stuff !! :)>-
  • Braydon_SFXBraydon_SFX Posts: 8,981Member, Sous Chef, PRO, Bowlboy Sidekick GameSalad Employee
    Very cool. Thanks for sharing!
  • RThurmanRThurman Posts: 2,842Member, Sous Chef, PRO
    @ericzingeler -- That's really a great idea you have there. Thanks for sharing it with the community!
  • ericzingelerericzingeler Posts: 334Member
    Thanks guys!
  • kinzuakinzua Posts: 554Member
    Nice work bro. Thanks for sharing. Also put it in the thread by Socks 'Spare Code ! Dump It Here !' Thanks.
  • TheGabfatherTheGabfather Posts: 633Member
    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!

    0011 0010 0011 0010 0010 0000 0110 1101 0010 0000 0111 0011 0110 1001 0110 1110 0110 0111 0110 1100 0110 0101

  • ericzingelerericzingeler Posts: 334Member

    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 Posts: 36Member, PRO
    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 Posts: 36Member, PRO
    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 Posts: 822Member
    I can't open the project :(
  • EggeyGamesEggeyGames Posts: 51Member
    Awesome
  • aasulli1aasulli1 Posts: 1Member
    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 Posts: 559Member

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

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

    @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 Posts: 4,832Member, PRO

    @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.