Idiomatic way of sticking pics on a glass pane, and apply a transformation to the whole pane?

11 views
Skip to first unread message

Baldvin Kovacs

unread,
Dec 17, 2015, 5:12:23 PM12/17/15
to kojo-user
I wonder if it is possible to attach pics to some sort of an abstraction like a glass pane, and move the pane as a whole?

A use case would be to have ~ a few hundred or a few thousand small objects forming the background, and let the whole background move, giving the illusion of the player moving in a larger-than-screen world.

One way is to draw the background as a single Picture, but then collision detection doesn't tell which little object did we collide. So I wonder if there's a version of, say, GPics where a translation can be applied to the whole thing in an efficient manner.

Thanks,
Baldvin

Baldvin Kovacs

unread,
Dec 17, 2015, 5:32:22 PM12/17/15
to kojo-user
I found "scroll" for the canvas, which is probably one of the answers to my question.  (Using scroll I can simulate moving the background, I just need to move the non-background items to the opposite direction).

I am still interested though if there's some way to have several glass panes. Probably not, which is OK, I'm just curious if there's some features that I've missed while reading the code.

Baldvin

Baldvin Kovacs

unread,
Dec 17, 2015, 6:55:06 PM12/17/15
to kojo-user
Ah, never mind - I found that BasePicList mixes in CorePicOps. Sorry for the noise.

Baldvin

On Thursday, December 17, 2015 at 11:12:23 PM UTC+1, Baldvin Kovacs wrote:

Lalit Pant

unread,
Dec 17, 2015, 10:58:55 PM12/17/15
to Baldvin Kovacs, kojo-user
No worries. Happy hacking.

PS. If you want to contribute a Hungarian translation, instructions are available here: https://bitbucket.org/lalit_pant/kojo/wiki/Kojo%20Localization

/L

--
You received this message because you are subscribed to the Google Groups "kojo-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kojo-user+...@googlegroups.com.
To post to this group, send email to kojo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kojo-user/358264ae-900e-4f8f-be1b-a92a5f82ca66%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages