Skip to content

Commit

Permalink
finished functionality, tests are wip
Browse files Browse the repository at this point in the history
  • Loading branch information
fhradilak committed Jun 9, 2021
1 parent ffb1fee commit 552dbe9
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ addMorphFromSpec: aDictionary
morph := (self createMorphFromString: (aDictionary at: 'type')) openInWorld.
self loadStartProperties: (aDictionary at: 'properties') with: morph.
morphProperty := self addTargetMorph: morph.
self loadFramesFromJson: (aDictionary at: 'frames') with: morphProperty.
self loadFrames: (aDictionary at: 'frames') with: morphProperty.



Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
loadJson
framePropertiesDictionary:aFrameId
^ {#rotation -> [:anDictionary :aValue |(anDictionary at:'rotation') targetValues at: aFrameId put:aValue].
#positionX -> [:anDictionary :aValue | (anDictionary at: 'position') targetValues at: aFrameId put:aValue].
#positionY -> [:anDictionary :aValue | (anDictionary at: 'position') targetValues at: aFrameId put:aValue].
#width -> [:anDictionary :aValue | (anDictionary at: 'size') targetValues at: aFrameId put:aValue].
#height -> [:anDictionary :aValue | (anDictionary at: 'size') targetValues at: aFrameId put:aValue].
#color -> [:anDictionary :aValue | (anDictionary at: 'color') targetValues at: aFrameId put:aValue]} as: IdentityDictionary.




Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
loadJson
loadFrames: anArray with: anAnimationEditorProperty
|frameId|
anArray do:[:frame|
frameId:= frame at: 'frame'.
(frame at: 'properties')
do: [:each | ((self framePropertiesDictionary:frameId) at: (each at: 'name') asSymbol)
value: anAnimationEditorProperty subproperties
value: (each at: 'value')
]].

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"addColorFrame:" : "CL 5/30/2021 14:15",
"addFrame:" : "NB 5/12/2021 09:25",
"addKeyframe" : "CL 5/11/2021 09:40",
"addMorphFromSpec:" : "LW 5/15/2021 14:31",
"addMorphFromSpec:" : "FH 6/9/2021 09:28",
"addMorphToJson:with:" : "MH 6/1/2021 17:34",
"addPositionFrame:" : "CL 5/30/2021 14:18",
"addRotationFrame:" : "CL 5/30/2021 14:19",
Expand Down Expand Up @@ -45,6 +45,7 @@
"emptyPanels" : "DM 8/7/2020 17:37",
"emptyPanels:" : "DM 6/12/2020 20:40",
"framePropertiesDictionary" : "LW 5/23/2021 12:20",
"framePropertiesDictionary:" : "FH 6/9/2021 10:03",
"getDeepestMorph:at:" : "DM 6/22/2020 01:25",
"handleListenEvent:" : "DM 8/5/2020 21:11",
"handleLoadJsonButton" : "FH 5/20/2021 18:12",
Expand All @@ -55,7 +56,7 @@
"initialize" : "DM 6/22/2020 01:26",
"initializePropertyEditorPanel" : "DM 8/6/2020 10:38",
"insertMorph:Into:" : "JIZ 6/3/2020 16:56",
"loadFramesFromJson:with:" : "LW 5/15/2021 14:31",
"loadFrames:with:" : "FH 6/9/2021 10:20",
"loadJson:" : "LW 5/15/2021 14:30",
"loadJsonWithExceptionHandling:" : "FH 5/20/2021 17:44",
"loadMorphs:" : "LW 5/15/2021 14:14",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
accessing
createAnimationFor: aMorph withKey: aKey withLastKey: aLastKey withValue: aValue withLastValue: aLastTargetValue

^ AnimCompositeAnimation new
add:
(AnimAlphaBlendAnimation new
morph: aMorph;
startValue: 1.0;
endValue: 0.0;
duration: ((aKey-aLastKey)//2);
finishBlock: [aMorph color: aValue]);
finishBlock: [aMorph color: (Color colorFrom:aValue)]);
add:
(AnimAlphaBlendAnimation new
morph: aMorph;
startValue: 0.0;
endValue: 1.0;
duration: ((aKey-aLastKey)//2));
yourself.
yourself.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"buildUIWith:" : "JIZ 6/3/2020 17:10",
"canCreateAnimation" : "DM 8/6/2020 10:26",
"canRenderUI" : "DM 8/5/2020 21:07",
"createAnimationFor:withKey:withLastKey:withValue:withLastValue:" : "MH 6/1/2021 17:39",
"createAnimationFor:withKey:withLastKey:withValue:withLastValue:" : "FH 6/9/2021 10:31",
"defaultTargetColor" : "mjs 5/21/2021 11:39",
"initialize" : "DM 7/7/2020 10:44",
"targetColor" : "DM 8/7/2020 17:19",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ testLoadJsonTargetColor
}} as: Dictionary} as: Array.
morph := Morph new openInWorld.
morphProperty := self animationsEditorInstance addTargetMorph: morph.
self animationsEditorInstance loadFramesFromJson: data with: morphProperty.
self animationsEditorInstance loadFrames: data with: morphProperty.
self assert: (morphProperty subproperties at: 'color') targetColor = Color blue.
morph abandon.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ testLoadJsonTargetPosition
} as: Dictionary}} as: Dictionary} as: Array.
morph := Morph new openInWorld.
morphProperty := self animationsEditorInstance addTargetMorph: morph.
self animationsEditorInstance loadFramesFromJson: data with: morphProperty.
self animationsEditorInstance loadFrames: data with: morphProperty.
self assert: (morphProperty subproperties at: 'position') targetPosition = (48@104).
morph abandon.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ testLoadJsonTargetRotation
}as: Dictionary}} as: Dictionary} as: Array.
morph := Morph new openInWorld.
morphProperty := self animationsEditorInstance addTargetMorph: morph.
self animationsEditorInstance loadFramesFromJson: data with: morphProperty.
self animationsEditorInstance loadFrames: data with: morphProperty.
self assert: (morphProperty subproperties at: 'rotation') targetRotation = 40.
morph abandon.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ testLoadJsonTargetSize
}} as: Dictionary} as: Array.
morph := Morph new openInWorld.
morphProperty := self animationsEditorInstance addTargetMorph: morph.
self animationsEditorInstance loadFramesFromJson: data with: morphProperty.
self animationsEditorInstance loadFrames: data with: morphProperty.
self assert: (morphProperty subproperties at: 'size') targetSize = (50@40).
morph abandon.
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
"testLoadJsonPropertySize" : "LW 5/23/2021 12:05",
"testLoadJsonRectangleMorph" : "LW 5/23/2021 12:05",
"testLoadJsonStartEnd" : "LW 5/23/2021 12:05",
"testLoadJsonTargetColor" : "LW 5/23/2021 12:06",
"testLoadJsonTargetPosition" : "LW 5/23/2021 12:07",
"testLoadJsonTargetRotation" : "LW 5/23/2021 12:07",
"testLoadJsonTargetSize" : "LW 5/23/2021 12:07",
"testLoadJsonTargetColor" : "FH 6/9/2021 09:29",
"testLoadJsonTargetPosition" : "FH 6/9/2021 09:29",
"testLoadJsonTargetRotation" : "FH 6/9/2021 09:29",
"testLoadJsonTargetSize" : "FH 6/9/2021 09:29",
"testPlayAnimations" : "CL 5/30/2021 14:17",
"testSelectMorphByHand" : "DM 8/7/2020 18:59",
"testShowMessagePlayAnimation" : "CL 5/30/2021 14:17",
Expand Down

0 comments on commit 552dbe9

Please sign in to comment.