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