circles for NAT
This commit is contained in:
@@ -249,6 +249,10 @@
|
||||
(flatten (for name names
|
||||
(CreateMediaEntry medium name))))
|
||||
|
||||
(defCommand CreateCircleEntry [radius (Number 0 null null)]
|
||||
[(archive.createEntry ->e
|
||||
(addComponent archive e Circle (objectWith radius)))])
|
||||
|
||||
// TODO use Tag and VarTag arg types for AddTags and RemoveTags
|
||||
(defCommand AddTags [entries (SelectedEntries 1 null)
|
||||
tagsToAdd (VarText null)]
|
||||
|
@@ -5,6 +5,7 @@ import kiss.List;
|
||||
import flash.display.BitmapData;
|
||||
import flixel.addons.display.FlxExtendedSprite;
|
||||
import flixel.text.FlxText;
|
||||
import flixel.util.FlxSpriteUtil;
|
||||
import nat.Entry;
|
||||
import nat.Archive;
|
||||
import nat.ArchiveController;
|
||||
|
@@ -8,13 +8,20 @@
|
||||
&prop :ArchiveController controller]
|
||||
[&mut :Bool selected false]
|
||||
(super position.x position.y)
|
||||
(if (hasComponent e Images2)
|
||||
(cond
|
||||
((hasComponent e Images2)
|
||||
(let [images (readComponent e Images2)]
|
||||
(.onComplete (BitmapData.loadFromFile (joinPath archive.archiveDir "files" (nth images.imageFiles images.pinnedImageIndex)))
|
||||
->bitmapData {
|
||||
(loadGraphic bitmapData)
|
||||
}))
|
||||
(set pixels .pixels (new FlxText 0 0 0 (readComponent e Name) PlayState.TEXT_SIZE)))
|
||||
})))
|
||||
((hasComponent e Circle)
|
||||
(let [c (readComponent e Circle)
|
||||
diam (Std.int (* 2 c.radius))]
|
||||
(makeGraphic diam diam FlxColor.TRANSPARENT true)
|
||||
(FlxSpriteUtil.drawCircle this -1 -1 c.radius FlxColor.TRANSPARENT (object thickness 5 color FlxColor.LIME))))
|
||||
(true
|
||||
(set pixels .pixels (new FlxText 0 0 0 (readComponent e Name) PlayState.TEXT_SIZE))))
|
||||
(updateColor)
|
||||
(let [:Float scale (getScale e)]
|
||||
(this.scale.set scale scale)
|
||||
|
@@ -11,7 +11,7 @@
|
||||
(super
|
||||
playState
|
||||
->[archive e]
|
||||
?(hasComponent e Name)
|
||||
?(or (hasComponent e Name) (hasComponent e Circle))
|
||||
->[archive e pos &opt ui]
|
||||
(unless (sprites.exists e.id)
|
||||
(let [sprite (new EntrySprite this _playgroundKey pos archive e controller)]
|
||||
|
Reference in New Issue
Block a user