PySlither / Slither

A Python module for bridging Scratch and Python
http://pyslither.github.io/
MIT License
14 stars 6 forks source link

Layers - reordering or z-index? #26

Closed Tymewalk closed 8 years ago

Tymewalk commented 8 years ago

(For the last two tasks in #2.)

I was thinking about how I would go about doing layers with Slither and I came up with two solutions:

Re-ordering allows us to use "go to front" and "go back () layers" functions, but z-indexes would allow us to quickly sort the sprites list.

@BookOwl, @Omegabyte, what do you guys think?

ghost commented 8 years ago

Hmm

ghost commented 8 years ago

I'm thinking directly reorder the sprite list, adding z-indexes wold just increase complexity.

BookOwl commented 8 years ago

I think that we should use z-indexes because

  1. It would make it easy for the end user to get the z-index of a Sprite by just using sprite.zIndex
  2. It would be easy to implement. We would just need to do sorted(sprites, key=(lambda s: s.zIndex))
ghost commented 8 years ago

true

Tymewalk commented 8 years ago

So I think z-indexes are the way to go. I'll get on that, it shouldn't be too hard.

Tymewalk commented 8 years ago

In #31 I added the z-indexes. So I'm closing this since we've reached a conclusion and added it with no problems.