Text assets

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Text assets

Mihail Ivanchev
Hello, what is the correct type for text assets? I currently use <text path=.../>. I see a getText function in nme.installer.Assets, but getBytes is used for the asset ID in ApplicationMain. What am I doing wrong?
--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Text assets

Baluta Cristian
Sorry for the offtopic, but this nme it really needs it's own list, now people expect to know that they are talking about nme without even writing in the title.

On Thu, Oct 6, 2011 at 9:39 AM, Mihail Ivanchev <[hidden email]> wrote:
Hello, what is the correct type for text assets? I currently use <text path=.../>. I see a getText function in nme.installer.Assets, but getBytes is used for the asset ID in ApplicationMain. What am I doing wrong?
--
haXe - an open source web programming language
http://haxe.org



--
Băluță Cristian
http://ralcr.com
http://imagin.ro

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Text assets

Mihail Ivanchev
I just forgot to put [NME] in this post, cheesh, no one expects that :)

On Thu, Oct 6, 2011 at 10:46 AM, Baluta Cristian <[hidden email]> wrote:
Sorry for the offtopic, but this nme it really needs it's own list, now people expect to know that they are talking about nme without even writing in the title.

On Thu, Oct 6, 2011 at 9:39 AM, Mihail Ivanchev <[hidden email]> wrote:
Hello, what is the correct type for text assets? I currently use <text path=.../>. I see a getText function in nme.installer.Assets, but getBytes is used for the asset ID in ApplicationMain. What am I doing wrong?
--
haXe - an open source web programming language
http://haxe.org



--
Băluță Cristian
http://ralcr.com
http://imagin.ro

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Text assets

singmajesty
In reply to this post by Baluta Cristian
NME has a forum, at http://www.haxenme.org/forums

Being a Haxe-related topic, I do not think it is inappropriate for  
NME-related questions to come up in the Haxe mailing list. If I don't know  
the answer to something, or the subject appears to be wrongly titled, I  
can be understanding and overlook those "mistakes" or simply ignore the  
topic.


On Thu, 06 Oct 2011 01:46:41 -0700, Baluta Cristian  
<[hidden email]> wrote:

> Sorry for the offtopic, but this nme it really needs it's own list, now
> people expect to know that they are talking about nme without even  
> writing
> in the title.
>
> On Thu, Oct 6, 2011 at 9:39 AM, Mihail Ivanchev <[hidden email]>  
> wrote:
>
>> Hello, what is the correct type for text assets? I currently use <text
>> path=.../>. I see a getText function in nme.installer.Assets, but  
>> getBytes
>> is used for the asset ID in ApplicationMain. What am I doing wrong?
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>>
>
>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Text assets

singmajesty
In reply to this post by Mihail Ivanchev
Hi Mihail,

Types are assigned automatically, based on file extensions. However, as  
you mentioned, you can explicitly control which type a file is assigned to  
by either adding a "type" attribute, or if it is a child to an "assets"  
node, you can name the node the type you wish to use. These are all  
optional.

Currently, nme.Assets is designed to allow access to every file using  
Assets.getBytes. If you add a file using "asset" as the type, or no type,  
or anything you make up that is not one of the understood types (like  
"font", "sound", "image" or "music") then it will always be available  
through Assets.getBytes

Assets.getText is a convenience function, which loads the file using  
getBytes, then parses it as UTF text. Since reading text files (like  
*.txt, *.xml or *.json) is fairly common, I thought it would be good to  
provide a way to load these assets simply, rather than having to know the  
bytes -> string conversion code yourself.


On Thu, 06 Oct 2011 01:39:17 -0700, Mihail Ivanchev <[hidden email]>  
wrote:

> Hello, what is the correct type for text assets? I currently use <text
> path=.../>. I see a getText function in nme.installer.Assets, but  
> getBytes
> is used for the asset ID in ApplicationMain. What am I doing wrong?

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Text assets

Yanis Benson
In reply to this post by singmajesty

It surely is a proper place, but nowadays more than a half of topics is about NME(I checked it on my inbox a minute ago), and I guess many haXe users don't care about NME at all. So it's not that it's wrong, but taking me as an example, I'll be more comfortable not deleting it every time. I can make a filter of course, but I prefer not to filter my mail.) So I will be kind of happy if NME related topics will be moved somewhere else.

On 6 Oct 2011 19:16, "Joshua Granick" <[hidden email]> wrote:
NME has a forum, at http://www.haxenme.org/forums

Being a Haxe-related topic, I do not think it is inappropriate for NME-related questions to come up in the Haxe mailing list. If I don't know the answer to something, or the subject appears to be wrongly titled, I can be understanding and overlook those "mistakes" or simply ignore the topic.


On Thu, 06 Oct 2011 01:46:41 -0700, Baluta Cristian <[hidden email]> wrote:

Sorry for the offtopic, but this nme it really needs it's own list, now
people expect to know that they are talking about nme without even writing
in the title.

On Thu, Oct 6, 2011 at 9:39 AM, Mihail Ivanchev <[hidden email]> wrote:

Hello, what is the correct type for text assets? I currently use <text
path=.../>. I see a getText function in nme.installer.Assets, but getBytes
is used for the asset ID in ApplicationMain. What am I doing wrong?
--
haXe - an open source web programming language
http://haxe.org




--
haXe - an open source web programming language
http://haxe.org

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Text assets

Baluta Cristian
I was about to say the same thing. Beside that, the forum looks cool and if people will use it, the newcomers will see that has some activity and is not an obscure product, and i'll also know where to search for answers when i'll decide i want to use it.

On Fri, Oct 7, 2011 at 3:10 PM, Yanis Benson <[hidden email]> wrote:

It surely is a proper place, but nowadays more than a half of topics is about NME(I checked it on my inbox a minute ago), and I guess many haXe users don't care about NME at all. So it's not that it's wrong, but taking me as an example, I'll be more comfortable not deleting it every time. I can make a filter of course, but I prefer not to filter my mail.) So I will be kind of happy if NME related topics will be moved somewhere else.

On 6 Oct 2011 19:16, "Joshua Granick" <[hidden email]> wrote:
NME has a forum, at http://www.haxenme.org/forums

Being a Haxe-related topic, I do not think it is inappropriate for NME-related questions to come up in the Haxe mailing list. If I don't know the answer to something, or the subject appears to be wrongly titled, I can be understanding and overlook those "mistakes" or simply ignore the topic.


On Thu, 06 Oct 2011 01:46:41 -0700, Baluta Cristian <[hidden email]> wrote:

Sorry for the offtopic, but this nme it really needs it's own list, now
people expect to know that they are talking about nme without even writing
in the title.

On Thu, Oct 6, 2011 at 9:39 AM, Mihail Ivanchev <[hidden email]> wrote:

Hello, what is the correct type for text assets? I currently use <text
path=.../>. I see a getText function in nme.installer.Assets, but getBytes
is used for the asset ID in ApplicationMain. What am I doing wrong?
--
haXe - an open source web programming language
http://haxe.org




--
haXe - an open source web programming language
http://haxe.org

--
haXe - an open source web programming language
http://haxe.org



--
Băluță Cristian
http://ralcr.com
http://imagin.ro

--
haXe - an open source web programming language
http://haxe.org