'From etoys3.0 of 24 February 2008 [latest update: #1985] on 26 April 2008 at 5:34:59 pm'! "Change Set: StarMorphScripting Date: 26 April 2008 Author: Karl Ramberg Adds two scripting access points to StarMorphs."! !Player methodsFor: 'vertices operation' stamp: 'kfr 4/26/2008 17:22'! getStarRatio ^ (self costume starRatio * 100) rounded! ! !Player methodsFor: 'vertices operation' stamp: 'kfr 4/26/2008 17:27'! setStarRatio: aInteger | int float | int := aInteger min: 100 max: 1. float := (100 / int) asFloat. ^ self costume starRatio: float! ! !Player methodsFor: 'vertices operation' stamp: 'kfr 4/26/2008 17:09'! setVerticesCount: aInteger | verticesCount int | verticesCount := self getVerticesCount. int := aInteger. aInteger > verticesCount ifTrue: [int even ifFalse: [int := int + 1]. self costume makeVertices: int] ifFalse: [int even ifFalse: [int := int - 1 max:4]. self costume makeVertices: int]! ! !StarMorph class methodsFor: 'scripting' stamp: 'kfr 4/26/2008 17:31'! additionsToViewerCategories "Answer a list of ( ) pairs that characterize the phrases this kind of morph wishes to add to various Viewer categories." ^ # ( (star ( (slot verticesCount 'How many vertices are within me' Number readWrite Player getVerticesCount Player setVerticesCount:) (slot starRatio 'How long vertices are within me' Number readWrite Player getStarRatio Player setStarRatio:) )) )! ! !StarMorph class reorganize! ('parts bin' descriptionForPartsBin) ('class initialization' initialize registerInFlapsRegistry unload) ('scripting' additionsToViewerCategories) !