Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi, is it possible to load multiple textures from one file? Like in sprite method where you can have several textures drawn side by side in the same picture? best regards, Mariusz |
||||
|
If it is possible to copy the content of your image into a canvas (which should be possible), I think you can use createTextureFrom2DCanvas() from the renderer class for this, to create a single texture. |
||||
|
Thanks, but I need something different. I want several textures made from one picture. Not one texture made from several files. I would like to create texture from a rectangular region of an image. Or maybe I could put an image on a canvas with some x and y offset with use of CSS and then create texture with createTextureFrom2DCanvas? Would it take only a visible fragment or whole image? |
||||
|
I think erik understood what you wanted to do, and you are on the right track. Copy each parts of your picture you want to make a separate texture of into a canvas, and use createTextureFrom2DCanvas for it. Takes about 20 lines of JavaScript I guess, but it should work. |
|