This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-08-12 20:42:45

DewleafWolf
Scratcher
Registered: 2011-01-13
Posts: 100+

How to get the mouse to draw using pen script?

Okay, probably the most BASIC question I've ever asked, but I just don't know how to do it! XD

Easy, right? I just need the mouse to draw when you hold it down and drag. So many projects with this script, but if you could give the basic script to me here, I would appreciate it SO much. Thanks in advance.

- DewleafWolf

Offline

 

#2 2011-08-12 20:45:21

ImagineIt
Scratcher
Registered: 2011-02-28
Posts: 1000+

Re: How to get the mouse to draw using pen script?

Make a tiny pixel sprite with ghost effect at 100 that follows the mouse. Make it so that if the mouse is down put the pen down otherwise keep it up. Happy to help!

Offline

 

#3 2011-08-12 20:59:19

Thescratch3
Scratcher
Registered: 2011-06-14
Posts: 1000+

Re: How to get the mouse to draw using pen script?

ImagineIt wrote:

Make a tiny pixel sprite with ghost effect at 100 that follows the mouse. Make it so that if the mouse is down put the pen down otherwise keep it up. Happy to help!

Yea that is the MOST basic way possible  wink


View my projects. Or face The scratch curse! (Get it?)
http://i56.tinypic.com/2cdk8hy.png

Offline

 

#4 2011-08-12 21:55:13

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: How to get the mouse to draw using pen script?

Well, I'd just hide the sprite instead of ghosting it  big_smile


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#5 2011-08-12 22:13:10

ImagineIt
Scratcher
Registered: 2011-02-28
Posts: 1000+

Re: How to get the mouse to draw using pen script?

MoreGamesNow wrote:

Well, I'd just hide the sprite instead of ghosting it  big_smile

Oh yeah! I forgot that the pen still works if it's hidden!

Offline

 

#6 2011-08-13 15:16:27

DewleafWolf
Scratcher
Registered: 2011-01-13
Posts: 100+

Re: How to get the mouse to draw using pen script?

Could you give me the script for it?  hmm  It doesn't seem to work for me.

Offline

 

#7 2011-08-13 21:43:05

LordSydney
Scratcher
Registered: 2011-04-20
Posts: 100+

Re: How to get the mouse to draw using pen script?

DewleafWolf wrote:

Could you give me the script for it?  hmm  It doesn't seem to work for me.

Look at my paint project (click the "my latest project" link in my signature).


Need help with BBCode?
http://i.imgur.com/IfWrL.gifAlso check this out!http://i.imgur.com/YgF2v.gif

Offline

 

#8 2011-08-14 08:50:10

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: How to get the mouse to draw using pen script?

<when green flag clicked>
<hide>
<forever>
        <if><mouse down?>
                <pen down>
        <else>
                <pen up>
        <end>
<end>

Last edited by MoreGamesNow (2011-08-14 08:50:24)


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#9 2011-08-14 16:02:27

DewleafWolf
Scratcher
Registered: 2011-01-13
Posts: 100+

Re: How to get the mouse to draw using pen script?

That's what I have. I guess that part works, the problem is getting the pen feature to show up when Paint is opened, (It is a computer simulation. Paint is one of the programs.) and clear when closed. If anyone needs me to post the demo of the project for help, I can.  wink

Offline

 

#10 2011-08-14 16:05:46

ImagineIt
Scratcher
Registered: 2011-02-28
Posts: 1000+

Re: How to get the mouse to draw using pen script?

put when I receive paint instead of when flag clicked and put repeat until paint = 0 instead of forever
Then put when I receive menu hide.

Offline

 

#11 2011-08-14 19:08:30

DewleafWolf
Scratcher
Registered: 2011-01-13
Posts: 100+

Re: How to get the mouse to draw using pen script?

Okay! Thanks. I'll try that.

Offline

 

#12 2011-08-14 21:52:34

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: How to get the mouse to draw using pen script?

Oh, and I'm not sure if this is a problem, but you can't paint over a sprite, so if your painting-window is a sprite, make sure the canvas part is clear to the background.

P.S. When making mine, I made a sprite the covered the toolbar, this worked great for preventing the user from drawing beyond the boundaries of their window and into the toolbar.


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#13 2011-08-15 03:54:52

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: How to get the mouse to draw using pen script?

Also, the sprite will get dragged in the normal view. use presentation view.


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#14 2011-08-15 15:09:48

DewleafWolf
Scratcher
Registered: 2011-01-13
Posts: 100+

Re: How to get the mouse to draw using pen script?

MoreGamesNow wrote:

Oh, and I'm not sure if this is a problem, but you can't paint over a sprite, so if your painting-window is a sprite, make sure the canvas part is clear to the background.

P.S. When making mine, I made a sprite the covered the toolbar, this worked great for preventing the user from drawing beyond the boundaries of their window and into the toolbar.

I never even thought of the toolbar part! Thanks!

As for the first answer, yes, the window is a sprite so that may be the problem... I'll try to fix it.

Offline

 

#15 2011-08-16 23:26:51

SheppardProductions
Scratcher
Registered: 2011-08-14
Posts: 100+

Re: How to get the mouse to draw using pen script?

Why would you want it to be pen script?

Offline

 

#16 2011-08-17 06:43:13

DigiTechs
Scratcher
Registered: 2011-04-30
Posts: 500+

Re: How to get the mouse to draw using pen script?

DewleafWolf wrote:

MoreGamesNow wrote:

Oh, and I'm not sure if this is a problem, but you can't paint over a sprite, so if your painting-window is a sprite, make sure the canvas part is clear to the background.

P.S. When making mine, I made a sprite the covered the toolbar, this worked great for preventing the user from drawing beyond the boundaries of their window and into the toolbar.

I never even thought of the toolbar part! Thanks!

As for the first answer, yes, the window is a sprite so that may be the problem... I'll try to fix it.

Easy way to fix: Hide all of the other sprites when paint is opened (Except startbar) And make a little gap on ur sprite, so the startbar will fit over it. Then, make the paint sprite the background. This is one of the most easyest ways I managed to do it.


I'm back.
Maybe.

Offline

 

Board footer