Commit Graph

5 Commits (79996ccd346b)

Author SHA1 Message Date
Noah ec0b5ba6ca Rename Go module 2022-09-24 15:17:25 -07:00
Noah ecdfc46358 Zoom And Edit
Progress on the Zoom feature: when you zoom in and out, you can draw
shapes accurately onto the level. Seems a little buggy if you edit
while scrolling (as in drawing a very long line).

The title screen buttons are now more colorful.
2021-09-11 17:02:01 -07:00
Noah 37f6177a17 Zoom In/Out Feature: WorldIndexAt Fixed
WorldIndexAt() translates the pixel below the mouse cursor in screen
space (0,0 at top-left corner of the application window) into a world
coordinate in the level shown inside the canvas, taking into account the
canvas's position on the window and the scroll position.

It now translates correctly when zoom In or Out, so the "Abs:" mouse
position level in the status bar shows correctly.

Zoom features that are still jank:

- Scrolling while zoomed in, the chunks to the top/left start unloading
  too rapidly and outpacing the scroll, eventually level is invisible
- Drawing and committing pixels to the image while zoomed in/out is
  unpredictable where the pixels actually land.
- Actors in the level don't move or zoom at all.
2021-07-13 18:04:25 -07:00
Noah ed492a4451 Progress on the Zoom In/Out Feature
* Got the level chunks AND the wallpaper to both scale UP and DOWN
  consistently together.
* Trying to draw new pixels while zoomed in/out ends up offsetting the
  pixels by 2X still. Still seems an issue between screen coordinates
  and world coordinates. Zoom in 2X and try and draw a line 64px from
  the corners of the screen? The committed line appropriately lands at
  the 64px coord on the level data but, zoomed in, it appears 2X to the
  right on the screen from where I dropped the cursor!
* When zooming OUT, the limit on number of chunks the viewport will try
  and render is not increased, leaving dead space in the screen; more
  chunks should render when there's room.
2021-07-11 21:54:28 -07:00
Noah 6e40d58010 WIP Zoom Tool
* Added Feature Flag support, run doodle with --experimental to enable
  all flags. Eraser Tool is behind a feature flag now.
* + and - on the top row of keyboard keys will zoom the drawing in and
  out in Edit Mode. The wallpaper zooms nicely enough, but level
  chunkers need work.
* A View menu is added with Zoom in/out, reset zoom, and scroll to
  origin options. The whole menu is behind the Zoom feature flag.
* Update README with lots of details for fun debug mode options to play
  around with.
2020-11-19 20:09:15 -08:00