redaur redaur wrote:
- The sprite is for drawing, you can use it to draw either entire texture or it’s fragment. What for are you “more interested in doing this with a texture object itself rather than a sprite”? Sounds like “I am hungry but do not want to eat”.
- The simpliest way is a custom node which is opaque but has transparent window on it.
- Well one thing that I’ve used in other frameworks is this method of using a much smaller texture to compose a larger thing, sort of like by tiling. It’s commonly used for things like UI elements such as dialog boxes, buttons etc. So imagine you have what will be a large dialog box, but you don’t want to waste space in your atlas by actually having this large, actual size dialog. So we’ve done things like make an image that has its width/height divisible by 3. The corners remain just corners, but you use the center thirds for tiling along the vertical and horizontal. Which allows you to have nice looking and fairly complex appearing dialog boxes (or buttons) but with a very small source asset. Which looks less ugly than taking something plain at a small size and just doing a generic stretch.
It seems like I could use sprites to do this, but I guess my question then is is that the most efficient way to do it? If I used them with the sprite batch node thing, is the performance such that drawing something like say a few dozen or more (all from the same base texture) would be ok? If so, then I could indeed just use sprites which solves the problem.
- Sounds good I’ll try that, thanks!