[Cuis-dev] [ANN] Cuis-Smalltalk-RoadTrip idle game + a question on implementing a ZoomPanMorph

Ian Jeffries mail at ianjeffries.net
Fri Mar 8 11:52:01 PST 2024


> Wrt the code I included before, what it does is to keep at the same pixel
position whe place under the cursor. I feel it is the intuitive behavior.

That's perfect-- it's exactly what Google Maps does so everyone's already
used to it.

I also updated [the panning method](
https://github.com/seagreen/Cuis-Smalltalk-RoadTrip/blob/3ded234c0e2db1903b7af1c4de54e4352b7a4652/RoadTrip.pck.st#L280)
and got rid of `#adjustPositionInOwner` as you suggested.

PS: Added you as a contributor in the README. Thanks!

On Fri, Mar 8, 2024 at 7:38 AM Juan Vuletich <juan at cuis.st> wrote:

> On 3/7/2024 11:33 AM, Ian Jeffries via Cuis-dev wrote:
>
> > Welcome to the Cuis community!
>
> Glad to be here, what a cool project. I'm very fond of small things in
> software, especially for fun (small in scope that is, not in the amount of
> work since getting something small isn't easy).
>
>
> Yep. The difference between "simple" and "easy"!
>
>
> I'll go ahead and respond about the things I've already done, and leave
> the rest for a later message.
>
> > But then I tried to understand what was going on with your code, and I
> > found a bug in the Cuis image, Rectangle class >> #center:extent: This
> > is the real reason for the jerking you see. I just pushed an update for
> > that. Please pull & install. It will be much better.
>
> Amazing! Thank you. I wasn't sure about posting before my car "game" even
> had roads, now I'm glad I did.
>
> > One last comment. You'd add ‘JSON’ as a prerequisite to your package, so
> > it is loaded automatically if needed.
>
> Done!
>
> > My first thought was "you'd use a PluggableScrollPane". You can put a
> > simpler morph, that knows nothing about panning and scaling in a
> > ScrollPane, and play with the halo to scale it. Most likely
> > PluggableScrollPane could use some tweaks (like handling the scaling,
> > and the pan / zoom gestures), but it is not far from what you need.
> > Separating RoadTrip from Zoom/Pan issues, by composing them instead of
> > subclassing, is better IMO. Besides, in places like City>>drawOn: you're
> > hiding cities out of bounds yourself, while PluggableScrollPane already
> > clips for you. At least that what I'd do.
>
> That does seem better. There's a wrinkle though in my case though: I don't
> want to set `clipsSubmorphs` to true since I want to be able to use the
> car's halo to move it off of the map. Having the car drive across the
> screen to get back to the game has melted people's minds when I show them
> Cuis.
>
>
> Hehehe. Yes, that's cool!
>
> So directly using the strategy of `PluggableScrollPane` is out, since my
> understanding is it works by a combination of moving the interior morph
> around while clipping what part of it's shown with `clipsSubmorphs`. I'll
> think about this some more.
>
>
> Right. Your approach is perfectly fine and works great.
>
> More to follow once I've tried out your code. Thank you for the help and
> encouragement.
>
>
> You're most welcome!
>
> Wrt the code I included before, what it does is to keep at the same pixel
> position whe place under the cursor. I feel it is the intuitive behavior.
>
>
> Cheers,
>
> --
> Juan Vuletichcuis.stgithub.com/jvuletichresearchgate.net/profile/Juan-Vuletichindependent.academia.edu/JuanVuletichpatents.justia.com/inventor/juan-manuel-vuletichlinkedin.com/in/juan-vuletich-75611b3twitter.com/JuanVuletich
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240308/5ce0ccd9/attachment.htm>


More information about the Cuis-dev mailing list