Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperLicht
multiple textures in one file

Registered User
2014-09-05 23:05:41


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,

Registered User
2014-09-06 10:52:59

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.

Registered User
2014-09-11 20:44:35

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?

2014-09-12 05:00:51

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.

Create reply:

Posted by: (you are not logged in)

Enter the missing letter in: "Interna?ional" (you are not logged in)




Possible Codes

Feature Code
Link [url] [/url]
Bold [b]bold text[/b]
Image [img][/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]



Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact