ambiera home ambiera home

Ambiera Forum

Discussions, Help and Support.

Create a new account, Search, or Login:
Name:  Password:
Ambiera Forum > CopperLicht
multiple textures in one file
Author Text

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


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.


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?


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:


Posted by: (you are not logged in)


Enter the missing letter in: "Internati?nal" (you are not logged in)


Text:

 

  

Forum 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


   





Software: Ambiera Light Forum. © 2008-2019 Nikolaus Gebhardt, Ambiera e.U.