more convenient drawing on hollywoo-flixel props
This commit is contained in:
@@ -33,11 +33,16 @@
|
|||||||
(doFor [wavPath jsonPath] (groups wavJsonPaths 2 Throw)
|
(doFor [wavPath jsonPath] (groups wavJsonPaths 2 Throw)
|
||||||
(newFlxVoiceTrack name wavPath jsonPath))))
|
(newFlxVoiceTrack name wavPath jsonPath))))
|
||||||
|
|
||||||
(method newFlxProp [name path]
|
(method newFlxProp [name path &opt :FlxSprite->Void prepareSprite]
|
||||||
(let [propSprite (new FlxSprite 0 0)]
|
(let [propSprite (new FlxSprite 0 0)]
|
||||||
(propSprite.loadGraphic path false 0 0 true) // Load props uniquely because they can be drawn on
|
(propSprite.loadGraphic path false 0 0 true) // Load props uniquely because they can be drawn on
|
||||||
|
(when prepareSprite
|
||||||
|
(prepareSprite propSprite))
|
||||||
(newProp name propSprite)))
|
(newProp name propSprite)))
|
||||||
|
|
||||||
|
(defMacro flxSprite [asset &builder b]
|
||||||
|
`(new FlxSprite 0 0 ,(b.field (symbolNameValue asset) (b.symbol "AssetPaths"))))
|
||||||
|
|
||||||
(method :Void update [:Float elapsed]
|
(method :Void update [:Float elapsed]
|
||||||
(#when debug
|
(#when debug
|
||||||
(when FlxG.keys.justPressed.N
|
(when FlxG.keys.justPressed.N
|
||||||
|
Reference in New Issue
Block a user