Scrolling in a Morphic game

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Scrolling in a Morphic game

Aidan Gauland-2
Hello,

I am developing a game in Morphic -- nothing serious; just a spare
time project -- and I have come to a tricky part: the viewport.  So
far, I have just put my Morphs in a PasteUpMorph for testing, but now
I need to have a viewport to a (game) world that is larger than the
screen, and be able to pan/scroll the view around the world.  I really
have no idea how I could or should do this in Morphic.  Maybe subclass
PasteUpMorph and override #drawSubmorphs?  Can anyone here offer any
advice with this?

Regards,
Aidan

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Scrolling in a Morphic game

Benjamin Van Ryseghem (Pharo)
I do not know if an API exist for this kind of stuff, but it could be really cool to add one ^^

I think that you should basically add a drawing method which take a rectangle as a parameter and display this rectangle from your original world's representation.
For scrolling, just adjust the rectangle.

I'm really interested in this kind of work, so let me know how your work progress :)

Good luck,
Ben

On Jan 26, 2011, at 2:11 AM, Aidan Gauland wrote:

> Hello,
>
> I am developing a game in Morphic -- nothing serious; just a spare
> time project -- and I have come to a tricky part: the viewport.  So
> far, I have just put my Morphs in a PasteUpMorph for testing, but now
> I need to have a viewport to a (game) world that is larger than the
> screen, and be able to pan/scroll the view around the world.  I really
> have no idea how I could or should do this in Morphic.  Maybe subclass
> PasteUpMorph and override #drawSubmorphs?  Can anyone here offer any
> advice with this?
>
> Regards,
> Aidan


Reply | Threaded
Open this post in threaded view
|

Re: Scrolling in a Morphic game

Tudor Girba
I am interested, too :)

Perhaps you want to take a look at the ScrollPane or GeneralScrollPane implementation.

Cheers,
Doru


On 26 Jan 2011, at 10:28, Benjamin wrote:

> I do not know if an API exist for this kind of stuff, but it could be really cool to add one ^^
>
> I think that you should basically add a drawing method which take a rectangle as a parameter and display this rectangle from your original world's representation.
> For scrolling, just adjust the rectangle.
>
> I'm really interested in this kind of work, so let me know how your work progress :)
>
> Good luck,
> Ben
>
> On Jan 26, 2011, at 2:11 AM, Aidan Gauland wrote:
>
>> Hello,
>>
>> I am developing a game in Morphic -- nothing serious; just a spare
>> time project -- and I have come to a tricky part: the viewport.  So
>> far, I have just put my Morphs in a PasteUpMorph for testing, but now
>> I need to have a viewport to a (game) world that is larger than the
>> screen, and be able to pan/scroll the view around the world.  I really
>> have no idea how I could or should do this in Morphic.  Maybe subclass
>> PasteUpMorph and override #drawSubmorphs?  Can anyone here offer any
>> advice with this?
>>
>> Regards,
>> Aidan
>
>

--
www.tudorgirba.com

"When people care, great things can happen."




Reply | Threaded
Open this post in threaded view
|

Re: Scrolling in a Morphic game

Aidan Gauland-2
On Wed, Jan 26, 2011 at 10:51:29AM +0100, Tudor Girba wrote:
> Perhaps you want to take a look at the ScrollPane or GeneralScrollPane implementation.

I found TransformMorph when looking at ScrollPane.  I think I'll use
that.

I'll post to this list when my game engine is usable, since there is
some interest in the scrolling part.

Regards,
Aidan

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Scrolling in a Morphic game

Igor Stasenko
On 29 January 2011 20:39, Aidan Gauland <[hidden email]> wrote:
> On Wed, Jan 26, 2011 at 10:51:29AM +0100, Tudor Girba wrote:
>> Perhaps you want to take a look at the ScrollPane or GeneralScrollPane implementation.
>
> I found TransformMorph when looking at ScrollPane.  I think I'll use
> that.
>\
Yep.
For 'moving' parts of scene add the transform morph and put all other
morphs to it,
then you can control their relative placement using single object.


> I'll post to this list when my game engine is usable, since there is
> some interest in the scrolling part.
>
> Regards,
> Aidan
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
>
> iEYEARECAAYFAk1EbOIACgkQjyzTRvYJmaVCoACdEVfyuP27WuuuhQ5S4IBoHdvd
> 0QMAn1pLqqst8KrxM75WFAXBbnQ+ZsUn
> =A6eJ
> -----END PGP SIGNATURE-----
>
>



--
Best regards,
Igor Stasenko AKA sig.