I need to make it so when you click on a certain colored sprite, the pen will change to the color of the sprite you just clicked on (I'm making a drawing program). Any ideas on how to do this??? If you have any clue on how to do this please REPLY!
Thanks so much,
amsteketee
Offline
Please Help!!!!!!!!!!!!!
Offline
On your pen sprite, have this script
when gf clicked forever if <<touching [white sprite v]?> and <mouse down?>> set pen color to [#FFFFFF]and you do that for each sprite colour
Last edited by zammer990 (2012-08-24 19:22:19)
Offline
zammer990 wrote:
On your pen sprite, have this script
when gf clicked forever if <<touching [white sprite v]?> and <mouse down?>> set pen color to [#FFFFFF]and you do that for each sprite colour
One of the few times that "if touching [] AND mouse down" is probably an acceptable alternative to "when sprite clicked". I'd make a minor modification:
when gf clicked forever if <mouse down?> if<touching [white sprite v]?> set pen color to [#FFFFFF] end if<touching [red sprite v]?> set pen color to [#FF0000] end etc.
Offline
@peopleabove I would take an entirely different approach. Here are my scripts:
On your current pen script, add this to the top of your forever:
when gf clicked set [color v] to [black] forever if <<touching [white v]?> or <<touching [red v]?> or <do this for all of your colors>>> pen up else pen down end if <(color) = [white]> set pen color to [#FFFFFF] end ^^ Do that for all of your colors pen scripts endNow, for each color sprite:
when [white] clicked set [color v] to [white]I know, it is quite inefficient...
Offline
BirdByte wrote:
@peopleabove I would take an entirely different approach. Here are my scripts:
...scripts...
I know, it is quite inefficient...
Yours may be "inefficient", but its pros are fairly good:
1) uses "when sprite clicked" (this is probably closer to what amsteketee wants)
2) provides a variable that contains the color's name.
In an effort to make an even better script ( ), here's my new script:
when gf clicked set pen color to [#000000] set [color v] to [black] forever wait until <not<mouse down?>> pen up wait until <mouse down?> pen down if<touching [black button v]?> set [color v] to [black] set pen color to [#000000] end if<touching [white button v]?> set [color v] to [white] set pen color to [#FFFFFF] end if<touching [red button v]?> set [color v] to [red] set pen color to [#FF0000] end etc.You can simply use a "background sprite" to cover the entire screen except the drawing zone, which will prevent the user from drawing outside of the "drawing zone".
Last edited by MoreGamesNow (2012-08-25 11:39:58)
Offline
Most of the software or the online drawing games use the same tools for drawing effects as in the real world like the pencils, marker, water color, crayons and so on, in order to allow the individuals to create the characters of their preferences.
Offline