I want to have a block:
[save image of scripts as [PNG^]].
The options will be PNG, GIF, and BMP (the ones scratch can write).
I have several codes ready:
spec:
('save scripts to image as %F' #- #saveScriptImageAs:)Dropdown menu:
$F = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #fileTypes;
choice: 'PNG'].Dropdown options:
fileTypes
^ #('PNG' 'GIF' 'BMP' )Current method:
saveScriptImageAs: t1
| t2 |
t2 _ self ownerThatIsA: ScratchScriptEditorMorph.
t2 saveScriptsToImage: t1Then in Scratch-UI-Panes -> ScratchScriptEditorMorph -> menu/button ops
saveScriptsToImage: t3
| t1 t2 |
t2 _ pageViewerMorph contents screenshot.
t1 _ ScratchFileChooserDialog
chooseNewFileDefault: ''
title: 'Save Scripts Snapshot'
type: #scriptsSnapshot.
t1 = #cancelled ifTrue: [^ self].
t1 size = 0 ifTrue: [^ self].
(t1 asLowercase endsWith: '.' , t3 asLowercase)
ifFalse: [t1 _ t1 , '.' , t3 asLowercase].
t3 = 'PNG' ifTrue: [t2 writePNGFileNamed: t1].
t3 = 'GIF' ifTrue: [t2 writeGIFFileNamed: t1].
t3 = 'BMP' ifTrue: [t2 writeBMPFileNamed: t1]How will it call it with the insert "t1" in the block?
Last edited by scimonster (2011-03-15 14:06:37)
Offline
The resulting block will tell the sprite to find its owner which is a ScratchScriptEditorMorph, which doesn't exist!
I'm not sure what you're asking...
Offline
Nice, could you tell me exactly what you are asking though.
Last edited by Pecola1 (2011-03-15 19:00:30)
Offline
All I want is to call a method with the insert t1.
Offline
Try and do it again.
Offline
shanemiller wrote:
Try and do it again.
I don't know how.
Offline