Layers
BlitzMax Forums/BlitzMax Programming/Layers
| ||
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 |
| ||
For use in what? The best way to do that can differ between uses. 2d Game? |
| ||
Yes in 2d Games |
| ||
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) |
| ||
I'm new to this, but is TSprite user data type, an object or something else? |
| ||
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) |
| ||
A layer is just a group. Group stuff together. |
| ||
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? |