theRAPTLab / gsgo

GEM-STEP Foundation repo migrated from GitLab June 2023
1 stars 1 forks source link

Support arbitrary screen and project aspect ratios in CharControl3 #791

Closed benloh closed 8 months ago

benloh commented 8 months ago

Problems

There were two problems:

  1. If the CharControl3 screen was narrower than the current project setting (e.g. where the blank black sidebars next to the simulation were not visible), then the drag area would be wrong and you would lose the dragger cursor.
  2. If the project settings used a different aspect ratio (e.g. 800 wide x 400 high), then the drag area would be wrong and you would lose the dragger cursor.

The Fix

Redid the algorithm for sizing the drag container to NOT assume a square aspect ratio. Load the current project settings to use the project-defined simulation size when calculating the drag container.

Other Fixes

To Test

  1. Resize CharController to be a very narrow window taller than it is wide -- the dragger cursor should still be visible.
  2. Change Project Settings to right: 800, left: -800. Save. Reload. The dragger cursor should still be visible.
  3. Quickly drag the cursor back and forth to make sure the dragger can keep up with the character.

Caveats

Project Settings actually supports arbitrary top/left/bottom/right values with the goal of supporting asymmetrical stage areas (e.g. you can have the stage offset to the right). The drag container does not currently support this. There may also be issues with the Viewer and other displays when using asymmetrical dimensions.

jdanish commented 8 months ago

The character controller was previously semi-transparent to allow us to see the character underneath, but is now opaque. Can you change that back?

jdanish commented 8 months ago

Also there appears to be a slight offset (character appears left on-screen of where it is on cc) (I'd expect the beaver to be as centered as the white circle).

Screenshot 2023-10-17 at 1 23 47 PM
benloh commented 8 months ago

Weird, I didn't change the opacity. I'm also not entirely sure why the offset problem appeared and then disappeared. But I undid a hack and that may have fixed it?
The Beaver picture is not centered to start with, so if you want it centered, you'll have to recenter the image. If you check the the various sun images you'll see that they're mostly centered. See 312645349ff05e218656bde92d58ea3a8e384913

benloh commented 8 months ago

Addressed with #780

benloh commented 8 months ago

PanelRounds Editing

PanelRound editing is now also fixed. See #790. round.id was originally used for arbitrary round definitions for Moths, but they are no longer necessary. If round.id is missing, editing project settings would inadvertently clobber the round definition. We fixed the problem by removing the use of ids. ids or lack of ids will no longer trigger an error.

jdanish commented 8 months ago

Looks good now!