Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(2 edits)

not sure if were asking how to do the "fancy" snap but if you're using (positive) integers only (ie, Screen coords), then ThisValue = (ThisValue/Size)*Size will return the nearest Snap position.

Since GetPointerX/Y() return Floats, ThisValue = FLOOR(GetPointerX()/Size)*Size will do the same while accounting for negative values (imagine a map editor using SetViewOffset() or the like where you may want Sprites, Text, etc, to Snap to position on both sides of 0,0).

for Atlas Decomposer, perhaps offering the option to Snap would be fitting. something like If ShiftKey() then Snap() else Dont while defining the Icon

(+1)

I do use SetViewOffset() to keep the spritesheet in the upper left corner. The Shift option is a good idea. Right now Shift+drag, Ctrl+drag, and Alt+drag all do the same thing, but I'll think about some options to allow snapping to the underlying grid. Maybe Space to snap all current sides to the grid, and Shift+drag to snap while resizing.