Playmaker Forum

PlayMaker News => General Discussion => Topic started by: edufurla on September 04, 2015, 08:31:26 PM

Title: Load Texture from custom folder[SOLVED]
Post by: edufurla on September 04, 2015, 08:31:26 PM
Is there any way lo load a texture (or sprite) from a specified folder (to a texture/sprite variable) without codding? (image file not inside the assets folder)
I found a lot of examples in internet but I do not understand C#.
I also found some questions about that in this forum, but did't find a solution.
If there is not, would be great if someone make an action to that.
Thx
Title: Re: Load Texture from custom folder
Post by: jeanfabre on September 09, 2015, 04:11:05 AM
Hi,

 It's called inside Unity "Resources", it's folder from where Assets can be loaded at runtime without any hardcoded binding when editing.

you'll find everything here:

http://hutonggames.com/playmakerforum/index.php?topic=3916.0

 The action ResourcesLoad (https://github.com/jeanfabre/PlayMakerCustomActions_U3/blob/master/Assets/PlayMaker%20Custom%20Actions/Resources/ResourcesLoad.cs) is also on the Ecosystem (http://j.mp/1Esn1mF)

 Bye,

 Jean
Title: Re: Load Texture from custom folder[SOLVED]
Post by: edufurla on September 09, 2015, 08:00:34 AM
Hi Jean.
I need to load textures and sprites outside the resourses folder.
Using "c:\textures" for example.
Something like the existing action "loadfromfile" that work with string, but working with texture and sprite.

Title: Re: Load Texture from custom folder[SOLVED]
Post by: jeanfabre on September 09, 2015, 09:11:58 AM
Hi,

 ah ok, I see.

try these links, explaning how to use the WWW to get it.

http://answers.unity3d.com/questions/813495/can-i-load-textures-outside-the-resources-folder.html

so here use the regular WWWObject action, it's the url path that will make this happen.

 Bye,

 Jean

Title: Re: Load Texture from custom folder[SOLVED]
Post by: edufurla on September 09, 2015, 09:26:42 AM
Hi Jean.
Thats really worked. Thank you.
In this example, for a texture called fur02.png, the path will be:
file://C:/textures/fur02.png

Any ideas to load a sprite? This action has only text, texture and movie texture.
Title: Re: Load Texture from custom folder[SOLVED]
Post by: jeanfabre on September 09, 2015, 01:04:09 PM
Hi,

 For this I made recently (http://hutonggames.com/playmakerforum/index.php?topic=10978.msg51956#msg51956) an action to load a sprite from www:

wwwSprite (https://github.com/jeanfabre/PlayMakerCustomActions_U4/blob/master/Assets/PlayMaker%20Custom%20Actions/Sprite/WWWSprite.cs)

You can get it from the Ecosystem (http://j.mp/1Esn1mF).

Bye,

 Jean
Title: Re: Load Texture from custom folder[SOLVED]
Post by: edufurla on September 10, 2015, 10:39:19 AM
Hi Jean.
That's works great.
Thank you.