How to create a drawing system?
Manto
Member Posts: 796
I would like to create a drawing system where you can draw lines.
I haven't found any tutorials from gamesalad pages.
Is there any way to create one?
Thanks.
I haven't found any tutorials from gamesalad pages.
Is there any way to create one?
Thanks.
Comments
based on tshirts line demo
Just make the poop a small dot
It may not be exactly what you want but it is a great start on touch to spawn
Just replace the terds with lines or dots or whatever... the eyes and all that can be replaced with lines.
It also has a quick system for switching what you want to spawn
It's a sort of .....a paint program
Not the greatest but it works lol
Maybe it's already explained in the project mentioned above, but I didn't want to download it. Like JamesZeppelin, I also found it offensive. HA HA!
lol
Touching the screen would spawn a line actor. That actor's rotation and size would change based upon the mouse position. If you read the math section in my book, you should know that can be accomplished with two functions... vector to angle and magnitude. The magnitude would determine the size of the line.
Once the finger is released, the line has to be locked. That can be accomplished with an actor attribute.
This is a straight line though, not curved.
http://gamesalad.com/game/play/79364
Are you stretching the actor width/height if the X or Y doesn't change? Or are you spawning at every pixel?
FRUIT NINJA!
It's similar to a chalkboard, where actors are being spawned at a fast rate - but this works a lot better. Basically lines are being drawn with the appropriate length and angle. (Did my post help?) It's quite seamless though. It's an excellent drawing tool.
I think there's a way to optimize it though. Instead of spawning segments every .1 seconds, perhaps a new line should be spawned when a change in angle is greater than 1° or the mouse is released. That way, the number of lines would be dramatically reduced.
It is possible! That is really amazing.
@ Photonics
Naw, I made that before I read this post. It's how I always figured a drawing program would have to work.. I only recently decided to share my knowledge with everyone else instead of hoarding it. It's kinda fun helping others, win-win, ya know? Now if only I could finish my superfun game! I've been in a bit of a rutt lately. That shall end NOW! Oct 15th my game WILL be done!
Your optimization sounds good. I made this in about 30 mins, your welcome to implement the optimization you speak of though, it sounds like it will work and it should cut down on the number of spawns. I'd be curious to know if it does work.
DrawSmash!
http://gamesalad.com/game/play/79413
Great demo! Should make it to be a completed game!
thank for share!
That is great!
Well done!