I can try to make this, but I need a bit of help. Within the sourcecode, what are the existing methods for copying a costume, deleting a costume, determining whether or not a point falls on or in a sprite, and the methods for changing the sprite via paint editor, how it can store the changes and such. What I will do is this: For the "pen down on top of sprite" I will have the current costume of the selected sprite clone itself, allow it to be edited outside of the paint editor, and delete the extra costume when it is done.
Offline
Take a look at Jens' Flip. I noticed that it actually points the individual costumes in the opposite direction, so you can end up with some that are flipped and some that aren't. As for all these methods, I'm sure they're in there...but it'll take some time finding them. I'll take a look at the source code to see if I can dig any of them up. (I have no knowledge of Squeak Smalltalk, so it might be best to wait for Jens to come and save us
)
Last edited by fullmoon (2008-07-20 19:00:29)

Offline
I already knew that, I just need help finding each specific method. I already spent an hour searching. Jens, help please!
Last edited by Cyclone103 (2008-07-20 20:20:35)
Offline
u could have stamping, that way the pen goes over the later stamp which means the pen will be infront
Offline
deatheater wrote:
u could have stamping, that way the pen goes over the later stamp which means the pen will be infront
![]()
Hm, thats true! Although we want to be able to draw on the sprite, and have the sprite be able to move with the pen the same.
Offline
There's something under System Browser>ScratchSpriteMorph>all>instance>touching that (I think) is the method tied to the <touching sprite?> block.
It says:
touching: t1
| t2 t3 t4 t5 t6 t7 |
t1 = #mouse
ifTrue:
[(t2 _ self ownerThatIsA: ScratchStageMorph) ifNil: [^ false].
^ self containsPoint: t2 adjustedCursorPoint].
t1 = #edge ifTrue: [^ self isOnEdge].
(t1 isKindOf: self class)
ifFalse: [^ false].
(self isHidden not and: [t1 isHidden not])
ifFalse: [^ false].
t3 _ self bounds intersect: t1 bounds.
(t3 width > 0 and: [t3 height > 0])
ifFalse: [^ false].
t4 _ Form extent: t3 extent depth: 2.
t5 _ t4 deepCopy.
t7 _ self visibility.
self visibility: 100.
self drawOn: ((FormCanvas on: t4)
copyOffset: t3 topLeft negated).
self visibility: t7.
t7 _ t1 visibility.
t1 visibility: 100.
t1 drawOn: ((FormCanvas on: t5)
copyOffset: t3 topLeft negated).
t1 visibility: t7.
t6 _ Bitmap new: 4 withAll: 1.
t6 at: 1 put: 0.
t4
copyBits: t4 boundingBox
from: t4
at: 0 @ 0
colorMap: t6.
t5
copyBits: t5 boundingBox
from: t5
at: 0 @ 0
colorMap: t6.
t5
displayOn: t4
at: 0 @ 0
rule: Form and.
^ (t4 tallyPixelValues at: 1)
< (t4 width * t4 height)
I have no idea what this means but it may be the method that determines whether a sprite is touching another. Is this anything you're looking for?
Last edited by fullmoon (2008-07-20 21:51:44)

Offline
How about:
Scratch-Objects>ScriptableScratchMorph>media>instance>drawNewCostume
or
Scratch-Objects>ScriptableScratchMorph>media>instance>duplicateMedia?
Last edited by fullmoon (2008-07-20 21:58:34)

Offline
fullmoon wrote:
How about:
Scratch-Objects>ScriptableScratchMorph>media>instance>drawNewCostume
or
Scratch-Objects>ScriptableScratchMorph>media>instance>duplicateMedia?
k, the problem with drawNewCostume is that it makes a new one, but it is blank...Ill have to try duplicate media. Although, this would have to be under ScratchSpriteMorph since it would only apply to sprites.
Offline
Any ideas Jens? I bet u could make this in a snap!
Offline