[etoys-dev] Etoys: Etoys-kfr.95.mcz

karl ramberg karlramberg at gmail.com
Mon Oct 24 17:00:29 EDT 2011


Yes, these could be in SketchMorph instead.
I also have to work out the range on the input of filter settings.
But this quick hack gave much improvement. Just 5 methods to add all
that functionality :-)
Player 'restore base graphic' works great as an undo.

Karl

On Mon, Oct 24, 2011 at 9:31 PM, Bert Freudenberg <bert at freudenbergs.de> wrote:
> IMHO these should be properties of a SketchMorph. When that property changes, its "rotatedForm" would be recomputed from its "originalForm", taking these properties into account (unless they have their default value). Sort of like independent filters - people rightly should expect this to work similar as in Scratch.
>
> Btw, with all these new features I'm getting excited about the 2011 release :) We should name it 4.2, at least.
>
> - Bert -
>
> On 24.10.2011, at 17:59, commits at source.squeak.org wrote:
>
>> Karl Ramberg uploaded a new version of Etoys to project Etoys:
>> http://source.squeak.org/etoys/Etoys-kfr.95.mcz
>>
>> ==================== Summary ====================
>>
>> Name: Etoys-kfr.95
>> Author: kfr
>> Time: 24 October 2011, 7:59:23 pm
>> UUID: 238320d7-b378-a746-892f-c4a910ffa21d
>> Ancestors: Etoys-bf.94
>>
>> Add blur: brightness: satruation: and hue: to graphics category. Now possible to play a little with picture colors etc.
>>
>> =============== Diff against Etoys-bf.94 ===============
>>
>> Item was added:
>> + ----- Method: Player>>blur: (in category '*Etoys-Scratch') -----
>> + blur: aWidth
>> +     | f fOut |
>> +     f := self getGraphic asFormOfDepth: 32.
>> +     fOut := f bits copy.
>> +     ScratchPlugin
>> +             primBlur: f bits
>> +             into: fOut
>> +             width: f width + aWidth.
>> +     f bits: fOut.
>> +     self
>> +             setGraphic: (f asFormOfDepth: 16)!
>>
>> Item was added:
>> + ----- Method: Player>>brightness: (in category '*Etoys-Scratch') -----
>> + brightness: aNumber
>> +     | f fOut |
>> +     f := self getGraphic asFormOfDepth: 32.
>> +     fOut := f deepCopy.
>> +     ScratchPlugin
>> +             primShiftBrightness: f bits
>> +             into: fOut bits
>> +             by: aNumber.
>> +     self
>> +             setGraphic: (fOut asFormOfDepth: 16)!
>>
>> Item was added:
>> + ----- Method: Player>>hue: (in category '*Etoys-Scratch') -----
>> + hue: aDegree
>> +     | f fOut degree |
>> +     degree := aDegree.
>> +     degree > 180
>> +             ifTrue: [degree := -360 + degree].
>> +     f := self getGraphic asFormOfDepth: 32.
>> +     fOut := f deepCopy.
>> +     ScratchPlugin
>> +             primShiftHue: f bits
>> +             into: fOut bits
>> +             byDegrees: degree.
>> +     self
>> +             setGraphic: (fOut asFormOfDepth: 16)!
>>
>> Item was added:
>> + ----- Method: Player>>saturation: (in category '*Etoys-Scratch') -----
>> + saturation: aNumber
>> +     | f fOut |
>> +     f := self getGraphic asFormOfDepth: 32.
>> +     fOut := f deepCopy.
>> +     ScratchPlugin
>> +             primShiftSaturation: f bits
>> +             into: fOut bits
>> +             by: aNumber.
>> +     self
>> +             setGraphic: (fOut asFormOfDepth: 16)!
>>
>> Item was changed:
>>  ----- Method: SketchMorph class>>additionsToViewerCategories (in category '*eToys-scripting') -----
>>  additionsToViewerCategories
>> +     ^ #(#(#graphics #(#(#slot #graphic 'The picture currently being worn' #Graphic #readWrite #Player #getGraphic #Player #setGraphic:) #(#command #wearCostumeOf: 'wear the costume of...' #Player) #(#slot #baseGraphic 'The picture originally painted for this object, but can subsequently be changed via menu or script' #Graphic #readWrite #Player #getBaseGraphic #Player #setBaseGraphic:) #(#command #restoreBaseGraphic 'Make my picture be the one I remember in my baseGraphic') #(#slot #rotationStyle 'How the picture should change when the heading is modified' #RotationStyle #readWrite #Player #getRotationStyle #Player #setRotationStyle:) #(#command #flipLeftRight 'Flip the picture left to right' #Player) #(#command #flipUpDown 'Flip the picture upside down' #Player) #(#command #blur: 'blur the image...' #Number) #(#command #hue: 'change color hue degree...' #Number) #(#command #brightness: 'change color brightness...' #Number) #(#command #saturation: 'change color saturation...'
>> #Number))) )!
>> -     "Answer a list of (<categoryName> <list of category specs>) pairs that characterize the phrases this kind of morph wishes to add to various Viewer categories."
>> -
>> -     ^ #((graphics (
>> - (slot graphic       'The picture currently being worn' Graphic       readWrite Player getGraphic Player setGraphic:)
>> - (command wearCostumeOf: 'wear the costume of...' Player)
>> - (slot baseGraphic   'The picture originally painted for this object, but can subsequently be changed via menu or script' Graphic     readWrite Player getBaseGraphic Player setBaseGraphic:)
>> - (command restoreBaseGraphic 'Make my picture be the one I remember in my baseGraphic')
>> -
>> - (slot rotationStyle 'How the picture should change when the heading is modified' RotationStyle readWrite Player getRotationStyle Player setRotationStyle:)
>> - (command flipLeftRight 'Flip the picture left to right' Player)
>> - (command flipUpDown 'Flip the picture upside down' Player)
>> - )))
>> -
>> -
>> - !
>>
>> _______________________________________________
>> etoys-dev mailing list
>> etoys-dev at squeakland.org
>> http://lists.squeakland.org/mailman/listinfo/etoys-dev
>
>
>
> _______________________________________________
> etoys-dev mailing list
> etoys-dev at squeakland.org
> http://lists.squeakland.org/mailman/listinfo/etoys-dev
>


More information about the etoys-dev mailing list