Karl Ramberg uploaded a new version of MorphicExtras to project Etoys:
http://source.squeak.org/etoys/MorphicExtras-kfr.45.mcz ==================== Summary ==================== Name: MorphicExtras-kfr.45 Author: kfr Time: 15 October 2011, 12:38:37 pm UUID: db7889bc-50b5-4048-a659-a51f5d5b85d7 Ancestors: MorphicExtras-kfr.44 Changes to use #getvalueFromCostume: in Player. outOfWorld: and inToWorld: creates some issues where the WecCameMorph starts stepping after being moved and dropped. Not solved yet... =============== Diff against MorphicExtras-kfr.44 =============== Item was changed: ----- Method: CameraInterface class>>cameraIsAvailable (in category 'camera ops') ----- cameraIsAvailable "Answer true if at least one camera is available." + ^(self cameraName: 1) notNil - | enableCamera | - enableCamera := false. - ^ enableCamera and: [(self cameraName: 1) notNil] ! Item was changed: ----- Method: Player>>getUseFrameSize (in category '*MorphicExtras-WebCam') ----- getUseFrameSize + ^ self getValueFromCostume: #getUseFrameSize. - ^ costume getUseFrameSize. ! Item was changed: ----- Method: Player>>getWebCamIsOn (in category '*MorphicExtras-WebCam') ----- getWebCamIsOn + ^ self getValueFromCostume: #getWebCamIsOn! - ^ costume getWebCamIsOn! Item was changed: ----- Method: Player>>getWebCamResolution (in category '*MorphicExtras-WebCam') ----- getWebCamResolution + ^ self getValueFromCostume: #getWebCamResolution! - ^ costume getWebCamResolution! Item was changed: ----- Method: Player>>setWebCamIsOn: (in category '*MorphicExtras-WebCam') ----- setWebCamIsOn: aBoolean + self setCostumeSlot: #setWebCamIsOn: toValue: aBoolean! - costume setWebCamIsOn: aBoolean! Item was changed: ----- Method: WebCamMorph>>initialize (in category 'initialization') ----- initialize super initialize. camNum := 1. camIsOn := false. captureDelayMs := 0. "stepTime" useFrameSize := false. resolution := #'medium'. frameExtent := self class resolutionFor: resolution. displayForm := Form extent: frameExtent depth:32. self extent: frameExtent. self on. ! Item was changed: ----- Method: WebCamMorph>>off (in category 'accessing') ----- off CameraInterface closeCamera: camNum. camIsOn := false. + self updateDisplay. self stopStepping. + - self updateDisplay ! Item was changed: ----- Method: WebCamMorph>>on (in category 'accessing') ----- on (CameraInterface cameraIsOpen: camNum) + ifTrue: [ ^camIsOn := true.]. - ifTrue: [^ false]. (CameraInterface openCamera: camNum width: frameExtent x height: frameExtent y) + ifNil: ["this fails sometimes"]. - ifNil: [^ false]. (Delay forSeconds: 1) wait. displayForm := Form extent: frameExtent depth:32. camIsOn := true. self startStepping. + ! - ^ true! Item was changed: ----- Method: WebCamMorph>>step (in category 'stepping and presenter') ----- step + | | + self updateDisplay. + ! - self updateDisplay! Item was changed: ----- Method: WebCamMorph>>updateDisplay (in category 'stepping and presenter') ----- updateDisplay + camIsOn - self getWebCamIsOn ifFalse: [displayForm getCanvas drawString: 'Camera is off' at: 5 @ 2 font: Preferences windowTitleFont color: Color white. ] + ifTrue:[self nextFrame]. - ifTrue:[self nextFrame]. self changed.! _______________________________________________ etoys-dev mailing list [hidden email] http://lists.squeakland.org/mailman/listinfo/etoys-dev |
Free forum by Nabble | Edit this page |