GLBasic forum

Main forum => GLBasic - en => Topic started by: spicypixel on 2012-Sep-16

Title: Loading Remote Sprites
Post by: spicypixel on 2012-Sep-16
I saw a code snippet/function on here months ago which I think Gernot wrote to load remote images. For some reason I just can't find it now, can anyone shed any light on this, or if I was dreaming :)
Title: Re: Loading Remote Sprites
Post by: hardyx on 2012-Sep-17
I don't saw this code, but you can make it using NEWWEBGET() pointing to the remote file in a web server and save in a local folder. Then you can use LOADSPRITE to load the local image.

Code (glbasic) Select
name$ = "image.png"
IF NETWEBGET ("www.myserver.com", "/images/"+name$, 80, name$) <> 0
  LOADSPRITE name$, 0
ENDIF
Title: Re: Loading Remote Sprites
Post by: spicypixel on 2012-Sep-17
Thanks for the reply I've done this to save to an external folder for usage on iPhone as I can't save to the MEDIA folder. I will post my code because there are some discrepancies whereby SETCURRENTDIR doesn't work as it should as if it forgets where the MEDIA folder is when you set it back so it might make things easier for others. If purely for the directory (bug?) issue.

That aside I have it working now anyway and should have updated the topic really *my bad*
Title: Re: Loading Remote Sprites
Post by: hardyx on 2012-Sep-17
In the iPhone you can't save data in the current directory (app folder), there is a separated folder for files. You must to use the path returned in PLATFORMINFO$("DOCUMENTS").
Title: Re: Loading Remote Sprites
Post by: spicypixel on 2012-Sep-18
Quote from: hardyx on 2012-Sep-17
In the iPhone you can't save data in the current directory (app folder), there is a separated folder for files. You must to use the path returned in PLATFORMINFO$("DOCUMENTS").

Yes I know that I've already done this like I mentioned above, there are also other issues regarding DIRs I'll post when I am able.
Title: Loading Remote Sprites
Post by: Kitty Hello on 2012-Sep-27
Or platforminfo$("temp")