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

#1 2010-08-12 05:17:52

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

The end Scratch code

When you press the cross on scratch it closes, wheres the code. I know it has code as when you dont save the image it says quit? and so on.


You can now reach me on Twitter @johnnydean1_

Offline

 

#2 2010-08-12 05:56:08

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: The end Scratch code

well it depends.
first of all you need the UnicodePlugin i tihnk.
then the code scratch uses is in the frameMorph, called quitScratch or quyitScratchNoDialog.

but that doesn't work in presentation mode. the simplest and most direct way of closing scratch without saving is
Smalltalk snapshot: false andQuite: true

Offline

 

#3 2010-08-12 06:07:47

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: The end Scratch code

I want to save the image as I quit scratch thats all.


You can now reach me on Twitter @johnnydean1_

Offline

 

#4 2010-08-12 06:09:27

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: The end Scratch code

oh. then it's sveImageForEndUser

Offline

 

#5 2010-08-12 06:17:32

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: The end Scratch code

Ok Ive changed a way of doing it but I still need to use your posts  wink


You can now reach me on Twitter @johnnydean1_

Offline

 

#6 2010-08-12 06:27:35

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: The end Scratch code

test

Last edited by LS97 (2010-08-12 06:29:00)

Offline

 

#7 2010-08-12 06:28:43

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: The end Scratch code

that was supposed to be caps. wierd  hmm
test 2:  big_smile

Offline

 

#8 2010-08-12 06:28:50

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: The end Scratch code

Im making it so games can save data in my new mod, I just needed to know where to find the quit scratch meathod. I found it before then lost it again!


You can now reach me on Twitter @johnnydean1_

Offline

 

#9 2010-08-12 06:29:44

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: The end Scratch code

ok  big_smile

*vomits on 60s rule*
T530OT5Y4FI20Z_JYET.0IREHYV

Offline

 

#10 2010-08-12 09:23:09

Billybob-Mario
Scratcher
Registered: 2008-01-05
Posts: 500+

Re: The end Scratch code

Code:

saveImage
| t1 |
t1 _ self ownerThatIsA: ScratchFrameMorph.
t1 saveImageForEndUser

Last edited by Billybob-Mario (2010-08-12 09:51:59)

Offline

 

#11 2010-08-12 09:29:23

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: The end Scratch code

no. more simply
saveImage
| t1 |
t1 _ self ownerThatIsA: ScratchFrameMorph.
t1 saveImageForEndUser

Offline

 

#12 2010-08-12 09:51:41

Billybob-Mario
Scratcher
Registered: 2008-01-05
Posts: 500+

Re: The end Scratch code

LS97 wrote:

no. more simply
saveImage
| t1 |
t1 _ self ownerThatIsA: ScratchFrameMorph.
t1 saveImageForEndUser

I used the wrong method. I'll fix it.

Offline

 

#13 2010-08-12 15:56:02

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: The end Scratch code

LS97 wrote:

no. more simply
saveImage
| t1 |
t1 _ self ownerThatIsA: ScratchFrameMorph.
t1 saveImageForEndUser

I think that won't work in presentation mode, try this:

saveImage
| t1 |
(t1 _ self ownerThatIsA: ScratchFrameMorph) ifNil: [(t1 _ (self ownerThatIsA: OffscreenWorldMorph) frame) ifNil: [^ self]].
t1 saveImageForEndUser


nXIII

Offline

 

Board footer