123 Commits over 92 Days - 0.06cph!
Fix divide by zero error when dragging sprite with single frame in first animation
Remove cooldown on resize so it's snappier
Added Multi-Select to Tiles List and supported MultiEdit in the Selected Tile Inspector.
Adding/Removing tiles no longer rebuilds entire list, only makes necessary changes. Also fixed a few NREs from previous commit
Can remove from selection when CTRL selecting in tile list
Can now MultiSelect from gizmos directly
https://files.facepunch.com/CarsonKompon/2024/July/26_20-12-InsidiousChinchilla.mp4
Can now create new tile even if tiles have yet to be generated. Will use current settings from Setup tab. Updated warning box text in Tiles tab to fit. Update inspector when adding first tile/removing last.
Adding/Removing tiles by clicking on gizmos are part of the undo stack
Tiles have their own Guid now. This does not get serialized and are assigned on load
Don't allow to box to resize into others. Prevent deselecting gizmo when resizing up-left
LabelTextEntry text now updates when property updates (if it was edited elsewhere)
Added "Selected Tile" section to Tileset Editor Inspector
Put Selected Tile section in an Expand Group so we can have ControlSheet groups within that are less confusing
Display [ReadOnly] Index in Selected Tile group
Removed TilesetResource.SheetRect and replaced it with two Vector2Ints (Position and Size).
Fixed can drag logic on Corners
Draw selected widget above others
Add CornerDrag Gizmos to Selected Tile. Change cursor when hovering based on direction. Show as hidden when movement is invalid.
Can click and drag Corners to resize the tile. Bunch of updates to invalid resize checks
https://files.facepunch.com/CarsonKompon/2024/July/26_14-08-PlainArmednylonshrimp.mp4
Move Editor Controls to Controls folder
Clean up some tile control styling
Added SelectedTile to Tileset Editor. Can select from list.
Deleted tiles show as ghost tiles, selected tile is highlighted and is a different colour.
Can click on Tile Gizmo to select it, right click to delete. Deleting selected tile will select first tile it can.
Clicking on ghost tile creates tile at that position. Make necessary fixes to allow swapping out sheets
https://files.facepunch.com/CarsonKompon/2024/July/26_12-06-NextMealworm.mp4
Organized Editor folder and made LabelTextEntry agnostic with OnStopEditing action
Add Name to TileResource.Tile
Fix not used warning
Add EmptyValue to LabelTextEntry
Add PixmapCache for creating cropped pixmaps from textures
Use PixmapCache in SpriteEditor
Created TileListControl and TileControl for TilesetEditor. Shows list of all created tiles. Shows preview icon. Can be renamed/reordered/ect.
https://files.facepunch.com/CarsonKompon/2024/July/26_10-38-TrickyHellbender.mp4
Add Regenerate Tiles button with warning beneath explaining what it will do
Only show warning when tiles already exist
Display image in Preview when set/updated.
Show import gizmos when in setup tab. Show WarningBox with a different message when trying to view Tiles tab with no Tiles
Generate Tiles button generates tiles from shown import gizmos. Doesnt display in Tiles tab yet
Start on Tiles tab if Tileset already has Tiles
Onlyu display new import gizmos when no tiles exist or when hovering the Regenerate Button
Added "Delete All Tiles" button when resource has tiles. When undoing/redoing an action the inspector will rebuild appropriately
Added Tile Gizmos. Hovering over a Tile Gizmo will highlight it. Implemented TilesetResource.CurrentTileSize so Setup variable can affect current tiles (with optional regeneration button)
https://files.facepunch.com/CarsonKompon/2024/July/26_00-18-MadeupHoneybee.mp4
MultiPick -> MultiSelect
Add SegmentedControl to Tileset Editor with Setup and Tiles tabs
Tileset Editor undo/redo works properly now and has undo steps for properties changing
Add Inspector to Tileset Editor
Add RenderingWidget/Preview to Tileset Editor
Add base settings to TilesetEditor Inspector. Minor changes to TilesetResource
Move SpriteRenderingWidget up to SpriteTools namespace
Move SpritesheetImporter from SpriteTools.SpriteEditor namespace to SpriteTools namespace and make import an Action that SpriteEditor hooks into.
Hook up SpritesheetImporter to TilesetEditor window
Updated TileResource structure and prepared for creating Tileset Editor
Move UndoStack from SpriteTools.SpriteEditor to SpriteTools namespace
Removed AllWindows from SpriteEditor. Removed some debug logs from SpriteEditor. StateCookie is based on resource opened
More updates to TilesetResource. TilesetResource is titled "2D Tileset" and Tileset Component is "2D Tileset component".
Added SpriteComponent and TilesetComponent to "2D" category
Basic TilesetEditor (Empty Window for now. Fitted with asset saving/loading, toolbars, undostack, ect.
Fix e defined but not set
Removed unused variable viewerPosition
Show preview tile under cursor when in Tileset Tool. Fit to Grid nicely
Import some tile assets
Test Tileset Resource
TilesetLayerControl deletes on right click without the additional popup
Rebuild TilesetToolInspector when Selected Layer changes. Serialize Selected Layer as part of the ControlSheet
Fixed TilesetComponent SceneObject vertex maths. Each layer now gets its own material, sharing materials between layers if same atlas is used.
Update Grid Size to follow Tileset size
Fix Selected Layer inspector update
TilesetComponent NRE fixes
Ask for confirmation before deleting animation w/ right click
Added .Copy() functions to Tile and Layer classes
TilesetToolInspector NRE fix
Added Context Menu to TilesetLayerControl
https://files.facepunch.com/CarsonKompon/2024/July/23_07-52-ImperfectAmphibian.mp4
Fix TilesetLayerListControl Height
Create TilesetSceneObject for drawing tiles in a single Graphics.Draw call.
Replace Delete IconButton with Lock Button.
https://files.facepunch.com/CarsonKompon/2024/July/23_08-49-GrowingMastiff.png
Added Dragging to re-order Layers
https://files.facepunch.com/CarsonKompon/2024/July/22_23-09-ThoughtfulNabarlek.mp4
Change Height of Layer Scroll Area
Darken the layer being dragged
Moved existing Code files into a "Sprite" folder
Create Tileset folder and add a basic TilesetResource
Add empty TilesetComponent with stripped Tile class. Will optimize this further later.
Began basic Tileset Tool, Draw grid with gizmo instead
Create TilesetToolInspector, rebuild on hotload
Strip TilesetComponent.Tile class and add TilesetComponent.Layer class
TileMapTools -> TilesetTools. Add ControlSheet to TilesetToolInspector
Create GameObject w Component when necessary
Added SelectedLayer and Active to TilesetTool.
Tileset Tool Header shows Selected Layer
Created Layer List Widget and Layer Widget, displays in both ToolInspector and TileComponent
https://files.facepunch.com/CarsonKompon/2024/July/22_22-51-HugeOtter.mp4
TilesetComponent.Layers is now a property under the Layers group
Fix gizmo bounds on SpriteComponent when origin was in lower-left quadrant
Optimize single non-spritesheet Sprites
Another TextureAtlas NRE fix when uninitialized
Fixed CellOffset visual display in Spritesheet Importer
Fixed Cell Offset in Import process
Fix TextureAtlas NRE when uninitialized
Fix more sprite component errors when no Sprite is set
Added popup to Create Sprites menu option allowing you to specify import settings for each sprite
https://files.facepunch.com/CarsonKompon/2024/July/18_19-26-TinyWrenchbird.mp4
Whoops creating sprite from menu didnt actually save the file
Fix error serializing SpriteComponent without a Sprite
Added Right Click Menu for creating 2D Sprite(s) from image files
https://files.facepunch.com/CarsonKompon/2024/July/18_18-16-TurbulentBongo.mp4
Fix Sprite Component gizmos erroring when no Sprite is set
Only run OnAnimationComplete if Game.IsPlaying
Changed SpriteComponent title to "2D Sprite Component" to prevent confusion with existing sprite components
Fix Sprite Objects being dragged in with an incorrect rotation
Added SpriteComponent.GetAttachmentTransform to get Transform of an attachment without having to create Attachment Objects
Added documentation to PlayAnimation function
Made Attach Points much more visible in the Sprite Editor
Hopefully prevent spontaneous crash when crating new Attach Points
Delete the test sprite
Fix sprites not initializing since SceneObject didn't exist before setter was set
Minor SpriteComponent Optimizations. SpriteComponent also updates properly when Sprite is changed after being initially set.
Cache textures for TextureAtlas.GetTextureFromFrame
Make CurrentTexture public on SpriteComponent.
Queue Broadcast Events so they can be run on the main thread to prevent code being unknowingly run on another thread
Give attach points proper rotations when flipped, respecting origin
Flip attach points when sprite is flipped
Don't update attachments in SpriteAnimationSystem, only do it when necessary
Update Attachments properly for non-square aspect ratios
Don't stretch asset preview/thumbnail for sprites with non-square aspect ratio
Timeline FrameButtons no longer stretch Sprites with non-square aspect ratio
Add TextureAtlas.AspectRatio
SpriteComponent now supports Sprites of non-square aspect ratios
Fixed not being able to click on Sprite Components to select them in the Scene
TextureAtlas now supports packing textures of non-square aspect ratio
Added Sprite Tools -> Flush Texture Cache to Menu
Fix origin/attach point pixel snapping on images that weren't square aspect ratios
Fix origin/attach point bounds and dragging on images that aren't square aspect ratio
"Point Controls" shortcut buttons now set origin directly instead of setting via the draggable
Add CTRL+Wheel to quickly zoom in/out of Sprite Editor Timeline
https://files.facepunch.com/CarsonKompon/2024/July/16_08-21-ThoroughVerdin.mp4
Fix default rotationOffset when placing a new sprite
Make sure attach points respect the UpDirection
Added UpDirection to SpriteComponent. Added JsonUpgrader to prevent previous components from becoming the new default.
Fix Frame -> Duplicate creating a duplicate reference of the current frame instead of a duplicate copy
Basic 2d player movement for example scene
https://files.facepunch.com/CarsonKompon/2024/July/14_21-17-MemorableSteed.mp4
SpriteDropObject now respects camera rotation
Remove shit we don't need in the example project anymore
Right Click -> Delete in the Sprite Editor Timeline will delete all selected frames if multiple are selected
Update Ninja Frog sprite to include all necessary animations
Add `HasBroadcastEvents` to SpriteComponent. Hide Broadcast Events in Inspector if `!HasBroadcastEvents`. Add `Bounds` to SpriteComponent
Add "footstep" events to Ninja Frog sprite
Remove all the old code files from the example project
Update the example scene
Fix broadcast events not firing on the first frame on the first loop. Fixed BroadcastEvents not firing when PlaybackSpeed is negative (reverse).
Fix StartingAnimationName returning "" when it couldnt find anim
Fallback when no obtainable origin for SpriteComponent gizmo
Remove the animator stuff for now. If I end up doing this it'll be on another branch
Micro-optimization
Add warning when calling PlayAnimation for an animation that doesnt exist
Prevent multiple toolbars in Sprite Editor
Can open multiple Sprite Editors to edit multiple sprites at once now
Remove UpdateWindowTitle from SpriteEditor Preview
Added Animator Dock/Tab to Sprite Editor
Update .sbproj files
Update example files