ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperLicht
forum topic indicator multiple textures in one file
person icon
cosmo
Registered User
Quote
2014-09-05 23:05:41

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

person icon
erik
Registered User
Quote
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.

person icon
cosmo
Registered User
Quote
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?

person icon
niko
Moderator
Quote
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:










 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






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