Layers

BlitzMax Forums/BlitzMax Programming/Layers

zambani(Posted 2008) [#1]
Hi everyone.
Does anyone have an idea of a way to implement Layers. Layers in that you can add images to it and then move them as a group?

Thanks in advance


Retimer(Posted 2008) [#2]
For use in what? The best way to do that can differ between uses.

2d Game?


zambani(Posted 2008) [#3]
Yes in 2d Games


Dreamora(Posted 2008) [#4]
Implement them.

As layers are nothing else than a drawing order just make a type TLayer and a TLayerManager.

The TLayerManager holds a TList of TLayer and a method Draw() the method draw goes through the list and calls on each TLayer the Draw method

and that method does nothing else then draw all elements in the layer (most likely TSprite or something that holds image, color, scale, rotation and position)


zambani(Posted 2008) [#5]
I'm new to this, but is TSprite user data type, an object or something else?


Dreamora(Posted 2008) [#6]
your own handling Type for Sprites. There is no 2D engine or the like within BM, just a 2D rendering system.
Anything above needs to be implemented by yourself (or you need to use a system that does it ... MGE or swifts BM sprite system)


ImaginaryHuman(Posted 2008) [#7]
A layer is just a group. Group stuff together.


Twitchfactor(Posted 2008) [#8]
I still think the best answer is the question, "What for?"

I found when I was doing tech support for GFA Assembler & GFA Basic (way back in tha 80's), people would ask me questions about a specific command or technique and it turned out that they were going down the wrong path for what they wanted to do.

So, what exactly is it you wish to accomplish?