playMaker

Author Topic: Add sprite in an Array from the project folder  (Read 1370 times)

CCS

  • Playmaker Newbie
  • *
  • Posts: 9
Add sprite in an Array from the project folder
« on: April 06, 2020, 11:00:05 AM »
Hello everyone,

I'm using playmaker since a few time now and made few games with it but I constantly have to add manually items in my (global) array to access them later like strings or sprite. It takes a lot of time.

I don't know if there is a solution to create arrays (accessible with playmaker standard bb) and complete them with sprites which are in the folder of my project.

Somethink like :
For each: in this folder ; array add.

CCS

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Add sprite in an Array from the project folder
« Reply #1 on: April 14, 2020, 07:16:15 AM »
No answers ?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Add sprite in an Array from the project folder
« Reply #2 on: April 15, 2020, 02:01:45 AM »
Hi,

 no, there isn't anything like that, the closest would be to use resources and then you don't need to list them, you simply load them by their name.


Can you explain what you are trying to achieve?

Bye,

 Jean

CCS

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Add sprite in an Array from the project folder
« Reply #3 on: April 15, 2020, 05:49:57 AM »
I have a system in the game which is updated with new pictures everyday by downloading few pictures (for a daily challenge). The number of pictures is between 28 and 1000 (very small pictures).

All the system to manage these pictures is already made with local pictures using arrays so I just want to plug the downloaded pictures which are in a folder of the project with an array.

I will do it by code if it's not possible but I'm surprised to be the only one who want to call assets from folder easily.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Add sprite in an Array from the project folder
« Reply #4 on: April 17, 2020, 09:18:13 AM »
Hi,

 for this, I would use persistent data folder and load sprites as textures via the www class for example, maintain the list via the player prefs so that you don't need to scan the folder, everytime you load an image in the cache, you save that reference to your player prefs.

EasySave allows you save arrays in prefs, so you could still use an array, and you would save that array straight.

Bye,

 Jean